Java Questionbank
Java Questionbank
COURSE OUTCOMES
On successful completion of this course, the student will be able to
Develop a simple Java program using all basic data types
C304.1
Develop a Java program with simple OOPS concepts
C304.2
C304.3 Build a basic Java program using Exception and I/O Streams.
Build a Java program using multi-threading and with generic class
C304.4
Develop a Java application using basic event handling and swing component concept
C304.5
MAPPING BETWEEN CO AND PO, PSO WITH CORRELATION LEVEL 1/2/3
P P P P P
P P P P P P P P P
Course 0 O O S S PS
O O O O O O O O O PS
Outcome 1 1 1 O O O
1 2 3 4 5 6 7 8 9 O3
0 1 2 1 2 4
C304.1 - - - 1 2 - - - 1 2 3 2 1 2 2 2
C304.2 2 1 1 3 2 - - - - 1 - 2 3 2 - -
C304.3 3 1 - 3 1 - - - - - - 1 2 2 - -
C304.4 3 2 3 3 3 - - - - - - 1 3 3 1 1
C304.5 3 1 3 3 3 - - - - - - 1 2 2 1 1
Sl. Knowledge
Course Content Course Outcome
No. level
11 File I/O:Standard Streams,Reading /Writing Streams R,U &Ap
12 Byte Array Stream,Data Stream R,U &Ap
13 File Stream,Input and Output Stream R,U &Ap
UNIT IV THREADS AND GENERIC CLASSES
Sl.
Knowledge
No. Course Content Course Outcome
level
1 Understanding Threads R&U
2 Needs of Multi-threaded Programming R&U
3 Thread Life-cycle. R,U, Ap& E
4 Thread Priorities,Synchronozing Threads R,U &Ap
5 Intercommunication of Threads R&U C304.4
6 Critical Factor in Thread,Deadlock R,U &Ap
7 Introduction to Generics R,U &Ap
8 Builtin Generic Collections R,U &Ap
9 Writing Simple Generic Class R,U &Ap
UNIT V JAVAFX EVENT HANDLING, CONTROLS AND COMPONENTS
FOR GUI PROGRAM
Sl. Knowledge
Course Content Course Outcome
No. level
1 JAVAFX Events and Controls: Event Basics U, Ap& E
2 Handling Key and Mouse Events. U, Ap& E
3 Controls:Checkbox, ToggleButton U, Ap& E
RadioButtons – ListView ,ComboBox – U, Ap& E
4 C304.5
ChoiceBox
5 Text Controls ScrollPane. Layouts – FlowPane U, Ap& E
6 HBox and VBox U, Ap& E
7 BorderPane,StackPane,GridPane Menus,Menu bars U, Ap& E
8 MenuItem. U, Ap& E
BL – Bloom’s Taxonomy Levels (1 – Remembering; 2– Understanding; 3 – Applying; 4 – Analysing,
5- Evaluating, 6-Creating)
UNIT I INTRODUCTION TO JAVA
History of Java-Environmental Setup -features of java-data types- variables- modifiers-keywords
operators- Iterative, Conditional and control statement - command line arguments - string- string
buffer - simple java program- enumerators-array-formatting output.
UNIT I/PART – A (CO: C304.1)
1. What are the OOP Principles?
The principles of object-oriented programming is Class inheritance, interface
BL1
implementation, abstraction of data and behavior, encapsulation of data and class
implementation, polymorphism and virtual methods.
2. What are the four cornerstones of OOP?
The following are the four cornerstones of OOP.
Abstraction: Can manage complexity through abstraction. Gives the complete overview
of a particular task and the details are handled by its derived classes. Example: Car.
Encapsulation: Nothing but data hiding, like the variables declared under private of a
BL1
particular class is accessed only in that class and cannot access in any other the class.
Inheritance: Is the process in which one object acquires the properties of another object,
ie., derived object.
Polymorphism: One method different forms, ie., method overriding and interfaces are
the examples of polymorphism.
10. Distinguish between procedure oriented programming (POP) and Object oriented
programming.(OOP)
POP OOP
In POP, program is divided into small In OOP, program is divided into parts
parts called functions. called objects.
POP does not have any access specifier. OOP has access specifiers named Public,
Private, Protected, etc. BL3
POP does not have any proper way for OOP provides Data Hiding so provides
hiding data so it is less secure. more security.
In POP, Overloading is not possible. In OOP, overloading is possible in the
form of Function Overloading and
Operator Overloading.
Example of POP are : C, VB, Example of OOP are : C++, JAVA,
FORTRAN, Pascal VB.NET, C#.NET.
11. What are the data types supported in Java?
Operator in java is a symbol that is used to perform operations like +, -, *, / etc. There
are many types of operators in java which are Unary Operator, Arithmetic Operator, BL1
Shift Operator, Relational Operator, Bitwise Operator,
Logical Operator, Ternary Operator and, Assignment Operator.
12. Define Abstraction.
Abstraction refers to the act of representing the essential features without including the
background details or explanations. It reduces the complexity and increases the BL1
efficiency. Small programs can be easily upgraded to large programs. Software
complexity can easily be managed.
13. What is Polymorphism?(Nov 2021)
Polymorphism is the ability to take more than one form and refers to an operation
exhibiting different behavior instances. Object oriented programs use polymorphism to
BL2
carry out the same operation in a manner customized to the object. It allows a single
name/operator to be associated with different operation depending on the type of data
passed to it.
14. Define Objects and Classes in Java(Nov 2018)
● Class is a collection of data and the function that manipulate the data. The data
components of the class are called data fields and the function components of the
class are called member functions or methods. The class that contains main
function is called main class. BL2
● Object is an instance of a class. The objects represent real world entity. The
objects are used to provide a practical basis for the real world. Objects are used to
understand the real world. The object can be declared by specifying the name of
the class.
15. Write the syntax for declaration of class and creation of objects?
A class is declared using class keyword. A class contains both data and method that
operate on that data. Thus, the instance variables and methods are known as class
members. When creating an object from a class
Declaration − A variable declaration with a variable name with an object type.
Instantiation − The 'new' keyword is used to create the object.
Initialization − The 'new' keyword is followed by a call to a constructor. This call
initializes the new object.
Class Student BL2
{ String name; int rollno;
int age;}
Student std=new Student( );
● std is instance/object of Student class.
● new keyword creates an actual physical copy of the object and assign it to the std
variable.
● The new operator dynamically allocates memory for an object.
16. Define Encapsulation (Apr 2012, Apr 2017, Nov 2020, April 2021,Dec 2021)
The wrapping up of data and functions into a single unit is known as data
encapsulation. Here the data is not accessible to the outside the class. The data BL1
inside that class is accessible by the function in the same class. It is normally not
accessible from the outside of the component.
17. What is Inheritance? What are its types?
● Inheritance is a mechanism of reusing the properties and extending existing
classes without modifying them, thus producing hierarchical relationships
between them.
● extends and implements keywords are used to describe inheritance in Java. BL2
Types of inheritance are: Single inheritance, Multi-level inheritance, Hierarchical
inheritance, Hybrid inheritance.
Syntax : Class Subclass-name extends Superclass-name
{ //methods and fields }
18. Define class (Nov 2011,Nov 2018)
Class is a template for a set of objects that share a common structure and a common BL1
behavior.
19. What do you mean by Dynamic Initialization?
Java is a flexible programming language which allows the dynamic initialization of
variables. In other words, at the time of declaration one can initialize the variables. In
java we can declare the variable at any place before it is used. BL2
Example:
int a=10;
float d=2.34f;
20. What do you mean by Variable? What are the rules for variable declaration?
Variable is a fundamental unit of storage in java. The variables are used in combination
BL2
with identifiers, data types, operators and some value for initialization.The syntax of
variable declaration will be: data type name_of_variable=[initialization];
21. What are the steps for execution of a java program?
A program is written in JAVA, the javac compiles it. The result of the JAVA compiler is
the .class file or the bytecode and not the machine native code (unlike C compiler).The
BL2
bytecode generated is a non-executable code and needs an interpreter to execute on a
machine. This interpreter is the JVM and thus the Bytecode is executed by the JVM &
finally program runs to give the desired output.
22. What do you mean by Bytecode? What is JVM and JIT?
Bytecode is an intermediate form of java programs.We get bytecode after compiling the BL2
java program using a compiler called javac. The bytecode is to be executed by java
runtime environment which is called as Java Virtual Machine(JVM). The programs that
are running on JVM must be compiled into a binary format which is denoted by .class
files. The JVM executes .class or .jar files, by either interpreting it or using a just-in-
time compiler (JIT). The JIT is used for compiling and not for interpreting the file. It is
used in most JVMs today to achieve greater speed. BL2
23. What are the different datatypes in Java?
TYPE SIZE RANGE SYNTAX
byte 8 bits -128 to 127 byte i,j;
short 16 bits -32768 to 32767 short a,b;
int 32 bits -2,147,483,648 int i,j;
to 2,417,483,647
long 64 bits -9,223,372,036,854,775,808 long x,y;
BL2
to 9,223,372,036,854,775,807
float 32 bits -9,223,372,036,854,775,808 float p,q;
to 9,223,372,036,854,775,807
double 64 bits 1.4e-045 to 3.4e+038 double a,b;
char 16 bits 4.9e-324 to 1.8e+308 char a;
boolean 1 bit true or false true or
false
30. What is method in java? How to define and call the method?
Method is a programming construct used for grouping the statement together to build a
function. There are two ways by which the method is handled.
1. Defining a method 2. Calling a method
Here is example that helps to understand the concept of method defining and calling.
public class methDemo { BL3
public static void main(String args[]) { int a=10;int b=20;int c=sum(a,b);
System.out.println(“The sum of “+a”+” and “+b+” is=”+c);
}
public static int sum(int num1,int num2)
{
int ans=num1+num2; return ans;}}
31. What is Assert Keyword? (Nov 2018)
An assertion allows testing the correctness of any assumptions that have been made in
the program.Assertion is achieved using the assert statement in Java. While executing BL1
assertion, it is believed to be true. If it fails, JVM throws an error named AssertionError.
assert expression; assert expression1 : expression2;
32. What is down casting?
Doing a cast from a base class to a more specific class. The cast does not convert the
object, just asserts it actually is a more specific extended object. BL1
e.g. Dalamatian d = (Dalmatian) aDog;
33. What are types of Constructors?
Default Constructor, Parameterized Constructor, Copy Constructors are the types of BL1
Constructors.
34. What's the difference between an interface and an abstract class?
An abstract class may contain code in method bodies, which is not allowed in an
interface. With abstract classes,you have to inherit your class from it and Java does not BL2
allow multiple inheritance. On the other hand, you can implement multiple interfaces in
your class.
35. What is meant by static?
When a member is declared as static it can be accessed before any objects of its class are
created and without any reference to any object. these are global variables, no copy of BL1
these variables can be made. staticcan also be declared for methods. and cannot refer to
this or super.
36. List any four Java Doc comments. [NOV 2011]
A Javadoc comment is set off from code by standard multi-line comment tags /* and */.
The opening tag, however, has an extra asterisk, as in /**.The first paragraph is a
BL1
description of the method documented. Following the description are a varying number
of descriptive tags, signifying: The parameters of the method (@param),What the
method returns (@return) and any exceptions the method may throw (@throws)
37. What are the access specifiers/modifiers for classes in Java?(Nov 2018,Nov 2019)
Java Access Specifiers (also known as Visibility Specifiers) regulate access to classes,
fields and methods in java. These specifiers determine whether a field or method in c
BL1
lass, can be used or invoked by another method in another class or sub-class. Access
Specifiers can beused torestrict access. There are 4 types of java access modifiers:
Private, Default, Protected and Public
38. What is a package?(Nov 2014)
A java package is a group of similar types of classes, interfaces and sub-packages.
Package in java can be categorized in two form, built-in package and user-defined BL1
package. There are many built-in packages such as java, lang, awt, javax, swing, net, io,
util, sql etc.
39. What is static methods in Java?
● A static method belongs to the class rather than object of a class.
BL1
● A static method can be invoked without the need for creating an instance of a
class.
● Static method can access static data member and can change the value of it.
There are two main restrictions for the static method is that the static method cannot use
non static data member or call non-static method directly.
40. What are the control flow statements in Java?( Nov 2020,April 2021)
A programming language uses control statements to control the flow of execution of
program based on certain conditions. These are used to cause the flow of execution to
advance and branch based on changes to the state of a program.
Java’s Selection statements:
• if
BL2
• if-else
• nested-if,if-else-if
• switch-case
• jump – break, continue, return
These statements allow you to control the flow of your program’s execution based
upon conditions known only during run time.
41 What is static variables in Java?
The static keyword in java is used for memory management mainly. We can apply java
static keyword with variables, methods, blocks and nested class. The static keyword
belongs to the class than instance of the class. If you declare any variable as static, it is
known static variable. BL1
The static variable can be used to refer the common property of all objects (that is not
unique for each object) e.g. company name of employees, college name of students etc.
The static variable gets memory only once in class area at the time of class loading.
Advantage - It makes your program memory efficient (i.e it saves memory).
UNIT-I / PART-B
1. Explain the various features of the Object Oriented Programming Language(Nov 2018) BL2
2. (i) With relevant examples explain abstraction and encapsulation.Write a Java program
that uses abstraction and encapsulation.Give self explanatory comments in your
program.(Nov 2014) BL2
(ii) What is polymorphism?Write a Java program that uses polymorphism.Give self
explanatory comments in your program.(Nov 2014,Nov 2019)
3. (i)List out the characteristics of Java.(May 2016)
BL2
(ii)Explain about dynamic method dispatch with an example..(May 2016)
4. How to pass and return the objects to and from the method? BL3
5. Discuss in detail the access specifiers available in Java. BL2
6. Explain the characteristics of OOP.(Nov 2018) BL2
7. Explain the difference between data hiding and data abstraction.(Nov 2019) BL2
8. Explain in detail the various characteristics of Java.(Nov 2019) BL2
9. Explain the concepts of arrays in Java and explain its types with examples? BL2
10. Explain in detail about finalize keyword? (Nov 2018) BL2
11. i) What is a constructor? What is the use of new method?
BL3
ii) Give the syntax for static method and its initialization
12. Write a java program for push and pop operations in stack using arrays in classes and
BL6
object.
13. (i) Write a Java Program to generate Fibonacci Series.(Nov 2017,April 2019) BL4
(ii) Explain how to declare arrays in Java.Give examples.(Nov 2017) BL2
14. i) What is meant by package? How it is created and implemented in JAVA. BL3,
ii) Write a JAVA program to find the smallest number in the given list BL6
15. Consider the following series of number:
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, etc.
BL5
Write a Java program to print the above series by getting the numbers of values to be
printed from the user(Nov 2022).
16. Write a Java Program to sort an array of ‘n’ names in alphabetic order.Use classes and
BL6
methods.(April 2018,Nov 2019)
17. Create a java program using local, static, instance variable with proper justification BL6
18. What is JVM?Explain the internal architecture of JVM with neat sketch.(Nov 2019) BL2
19. Develop a Java program to design the following pattern using any control flow
statements
*
* * BL6
* * *
* * * *
* * * * * (Nov 2022)
UNIT II OBJECT,CLASS,INTERFACES AND PACKAGES
Object-class-constructor-benefits of OOPS-concepts of OOPS- inheritance - polymorphism - abstract
class generic class- Overriding- Overloading- Interface: Implementation of interface-extending
interface-inner class- static and dynamic binding- package: Package as Access Protection-
CLASSPATH setting- Import packages.
UNIT-II / PART-A (CO: C304.2)
1. What is meant by Inheritance and what are its advantages?
Inheritance is a relationship among classes, wherein one class shares the structure or
behavior defined in another class. This is called Single Inheritance. If a class shares the
structure or behavior from multiple classes, then it is called Multiple Inheritance. BL1
Inheritance defines “is-a” hierarchy among classes in which one subclass inherits from
one or more generalized super classes. The advantages of inheritance are reusability of
code and accessibility of variables and methods of the super class by subclasses.
2. What is the difference between superclass and subclass?
A super class is a class that is inherited whereas sub class is a class that does the BL3
inheriting.
3. Brief about super keyword ( ). (Nov 2020,April 2021)
This is used to initialize constructor of base class from the derived class and also access BL1
the variables of base class like super.i = 10.
4. Differentiate between a Class and an Object.
The Object class is the highest-level class in the Java class hierarchy. The Class class is
used to represent the classes and interfaces that are loaded by a Java program. The
Class class is used to obtain information about an object's design. A Class is only a BL3
definition or prototype of real life object. Whereas an object is an instance or living
representation of real life object. Every object belongs to a class and every class
contains one or more related objects.
5. Define super class and subclass.
Super class is a class from which another class inherits.Subclass is a class that inherits BL1
from one or more classes.
6. What are the four types of access modifiers?
There are 4 types of java access modifiers:
1. private
BL1
2. default
3. Protected
4. public
7. What is protected class in Java?
A private member is only accessible within the same class as it is declared. A member
with no access modifier is only accessible within classes in the same package. A BL1
protected member is accessible within all classes in the same package and within
subclasses in other packages.
8. What is protected function?
Protected members that are also declared as static are accessible to any friend or member
function of a derived class. Protected members that are not declared as static are BL1
accessible to friends and member functions in a derived class only through a pointer to,
reference to, or object of the derived class.
9. What is protected method?
● A protected method can be called by any subclass within its class, but not by
BL2
unreleated classes.
● Declaring a method protected defines its access level.
Object. Every class in Java directly or indirectly extends (inherits from) this class.
32. Define Array list class.
The ArrayList class extends AbstractList and implements the List interface. ArrayList is
a generic class that has this declaration:
class ArrayList<E>
Here, E specifies the type of objects that the list will hold. BL1
An ArrayList is a variable-length array of object references. That is, an ArrayList can
dynamically increase or decrease in size. Array lists are created with an initial size.
When this size is exceeded, the collection is automatically enlarged. When objects are
removed, the array can be shrunk.
UNIT-II / PART-B
1. Explain the concept of inheritance with suitable examples. (Nov 2018,Nov 2019) BL2
2. Write a Java Proogram to calculate electricity bill using Inheritance.The program should
get the inputs of watts per hour and unit rate.Check your program for the following
case:Assume a consumer consumes 5000 watts per hour daily for one month.Calculate BL5
the total energy bill of that consumer if per unit rate is 7[1 unit= 1 k Wh]
(Nov 2020,April 2021)
3. Explain interfaces with example.( Nov 2020,April 2021,Nov 2021) BL2
4. Differentiate method overloading and method overriding. Explain with a program. BL3
5. Explain method overriding. with an example .(Nov 2021). BL2
6. Explain about the object and abstract classes with the syntax. BL2
7. Discuss in detail about inner class. With its advantages. BL3
8. What is meant by object cloning? Explain it with an example.(Nov 2019) BL2
9. Explain how inner classes and anonymous classes works in java program. BL3
10. What is a Package? What are the benefits of using packages? Write down the steps in
BL4
creating a package and using it in a java program with an example.
11. (i)What is inheritance? How inheritance is implemented in java?
(ii)Create a class Book and define display method to display book information. Inherit
Reference_Book and Magazine classes from Book class and override display method of BL5
Book class in Reference_Book and Magazine classes. Make necessary assumptions
required.(Nov 2022)
12. Develop an Interest interface which contains simpleInterest and compInterest methods
BL5
and static final field of Rate 25%. Write a class to implement those methods(Nov 2022)
13. Create an abstract Reservation class which has Reserve() abstract method. Implement the
sub-classes like ReserveTrain and ReserveBus classes and implement the same. Use BL6
necessary variables, methods for reserving tickets(Nov 2022)
UNIT III EXCEPTION AND FILE I/O STREAMS
Exceptions-benefits of exception-Types of Exceptions-Errors-Control flow- JVM reaction to Exception
usage of try, catch, throw, final and finally keyword-rethrowing exceptions, exception specification, built in
exceptions-File I/O: Standard Streams-Reading and writing Streams- Byte Array Stream-Data
Stream- File Stream- Input and output Stream.
UNIT-III / PART-A (CO: C304.3)
1. What are the types of errors?
BL1
Compile time errors and Run time errors are the two types of errors.
2. Define Java Exception.
A Java exception is an object that describes an exceptional (that is, error) condition that
BL1
has occurred in a piece of code. When an exceptional condition arises, an object
representing that exception is created and thrown in the method that caused the error.
3. State the five keywords in exception handling.
Java exception handling is managed via five keywords: try, catch, throw, throws, and BL2
finally.
4. What are the uses of exception ?
The class at the top of the exception class hierarchy is the Throwable class, which is a
direct subclass of the Object class. Throwable has two direct subclasses - Exception and BL2
Error. The Exception class is used for exception conditions that the application may
need to handle.
The isAlive() method returns true if the thread upon which it is called is still running. It
returns false otherwise. While isAlive() is occasionally useful, the method that you
will more commonly use to wait for a thread to finish is called join(). The general
form is: final void join() throws InterruptedException
This method waits until the thread on which it is called terminates
17. Define thread group.
Every Java thread is a member of a thread group. Thread groups provide a mechanism
for collecting multiple threads into a single object and manipulating those threads all at BL1
once, rather than individually. For example, you can start or suspend all the threads
within a group with a single method call.
18. Why do we need generics in Java?(Nov/Dec 2018)
Code that uses generics has many benefits over non-generic code: Stronger type checks
at compile time. A Java compiler applies strong type checking to generic code and issues BL2
errors if the code violates type safety.Fixing compile-time errors is easier than fixing
runtime errors, which can be difficult to find.
19. How to create generic class?
A class that can refer to any type is known as generic class. Here, we are using T type
parameter to create the generic class of specific type.
Let’s see the simple example to create and use the generic class.
Creating generic class:
BL2
class MyGen<T>{ T obj;
void add(T obj){this.obj=obj;} T get()
{return obj;} }
The T type indicates that it can refer to any type (like String, Integer, Employee etc.).
The type you specify for the class, will be used to store and retrieve the data.
20. How to declare a java generic bounded type parameter?
To declare a bounded type parameter, list the type parameter’s name, followed by the
extends keyword, followed by its upper bound, similar like below method.
Public static<T extends Comparable<T>>int compare(Tt1, Tt2)
{
BL2
return t1.compareTo(t2);
}
The invocation of these methods is similar to unbounded method except that if we will
try to use any class that is not Comparable, it will throw compile time error.Bounded
type parameters can be used with methods as well as classes and interfaces.
21. What are wildcards in generics?
In generic code, the question mark (?), called the wildcard, represents an unknown type.
The wildcard can be used in a variety of situations: as the type of a parameter, field, or BL1
local variable; sometimes as a return type (though it is better programming practice to
be more specific).
22. What is erasure in Java?
Generics were introduced to the Java language to provide tighter type checks at compile
BL1
time and to support generic programming. To implement generics, the Java compiler
applies type erasure to: Replace all type parameters in generic types with their bounds.
23. What are the restrictions on generics?
To use Java generics effectively, you must consider the following restrictions:
● Cannot Instantiate Generic Types with Primitive Types
● Cannot Create Instances of Type Parameters
● Cannot Declare Static Fields Whose Types are Type Parameters BL1
supports the following types of controls: Labels, Push Buttons, Check Boxes, Choice
Lists, Lists, Scrollbars, Text Components. These controls are subclasses of Component.
23. What is the difference between choice and list?
A Choice is displayed in a compact form that requires you to pull it down to see the list
of available choices and only one item may be selected from a choice. A List may be BL3
displayed in such a way that several list items are visible and it supports the selection of
one or more list items.
24. What are the different types of flowpanes in Java?
There are 2 types of flowpanes- horizontal and vertical where the former lays out the
child nodes in rows that wrap up along the pane width and latter lays out the child nodes BL1
in columns that wrap up along the pane height. Java
FlowPane can be instantiated from the class javafx.scene.layout.FlowPane.
25. How to use stackpane in JavaFX?
The node added first is placed at the bottom of the stack and the next node is placed on
top of it. The class named StackPane of the package javafx.scene.layout represents the BL2
stack pane layout. The Text Flow layout arranges multiple text nodes in a single
flow.The layout is based on the concept of stack itself in Java environment.
UNIT-V / PART-B
1. What is event delegation model and what are the event classes and event interfaces? BL2
2. Explain various components in AWT?(Nov 2018,Nov 2021) BL2
3. What is event handling in java? List out the available event classes and listener
BL2
interfaces with suitable example.
4. Explain the layout managers in Java also describe the concept of menu creation.(Nov
BL2
2018)
5. What is an adapter class? Describe about various adapter classes in detail. BL2
6. Explain about JComboBoxclass, JCheckBoxclass BL2
7. Develop a java program that have 11 text fields one submit button. When you press the
BL6
button first 10 text field’s average has to be displayed in the 11th text field..(Nov 2022)
8. Develop a java code that keeps the count of right clicks of mouse. BL4
9. Explain about JButtonclass, JTextAreaclass, JFrameclass BL2
10. Develop java program that changes the color of a filled circle when you make a right
BL6
click.
11. Outline the use of setSize(),getSize(),setVisible() and setTitle() methods when working
BL4
with frame windows with their signature.(Nov 2018)
12. How will you display an image on the frame in a window using java. BL4
13. Write a program to develop HBox and VBox BL3
14. Write a program to perform BorderPane BL3
15. Develop StackPaneand GridPanein Java BL3
16. Demonstrate any four mouse event handlers with example.(Nov 2020,April 2021) BL6
17. Explain about Menu bars and Menuitems. BL2
18. What is event delegation model and what are the event classes and event interfaces? BL2
19. Write a program to create a frame with the following menus, such that the corresponding
geometric object is created when a menu is clicked.
BL6
a.Circle. b.Rectangle.
c.Line. d.Diagonal for the rectangle. .(Nov 2022)
20. Write a Java program to implement a 3 frame in a window, In each frame create
BL6
rectangle and fill each one with (i) color (ii) texture and (iii) gradient.(Nov 2022)
21. Develop a Java program to implement the following Create four check boxes. The initial
state of the first box should be in checked state. The status of each check box should be
BL6
displayed. When we change the state of a check box, the status should be displayed and
updated. (Nov 2022)