0% found this document useful (0 votes)
26 views9 pages

Questions Bank JPR

The document is a question bank for a Java programming course, covering various topics such as basic syntactical constructs, derived syntactical constructs, inheritance, interfaces, packages, exception handling, multithreading, applets, graphics programming, and file management. It includes 2-mark, 4-mark, and 6-mark questions for each unit, asking for definitions, explanations, and programming tasks. The content is structured to assess students' understanding and application of Java concepts.

Uploaded by

Geetanjali Patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views9 pages

Questions Bank JPR

The document is a question bank for a Java programming course, covering various topics such as basic syntactical constructs, derived syntactical constructs, inheritance, interfaces, packages, exception handling, multithreading, applets, graphics programming, and file management. It includes 2-mark, 4-mark, and 6-mark questions for each unit, asking for definitions, explanations, and programming tasks. The content is structured to assess students' understanding and application of Java concepts.

Uploaded by

Geetanjali Patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Questions Bank

Sub:JPR (22412) Course Code:-CW/CO/CM/IF-4I

Unit:-I (Basic Syntactical Constructs in java) Marks-10

2 Marks Questions:-

1) List any eight features of Java


2) What is JVM ? What is bytecode ?
3) Define JDK. List the tools available in JDK explain anyone in detail.
4) Write general syntax of any two decision making statements and also give
its examples.

5) Describe any two relational and any two logical operators in Java with
simple example.
6) Explain break and continue statements with example.
7) Explain any two bit-wise operators with example
8) What is bytecode ? Explain any two tools available in JDK.

4 Marks Questions:-

1) Explain the concept of platform independence and portability with respect to


Java language
2) Define type casting. Explain its types with syntax and example.
3) Explain any two logical operators in Java with example..
4) State syntax and describe working of ‘for each’ version of for loop with one example.
5) Explain any four features of Java.
6) Describe break and continue statement with example.
7) Describe?, : (Ternary operator) in Java with suitable example.
8) Explain : 1) Platform independence 2) Compiled and interpreted features of Java.
9) Define a class having one 3-digit number as a data member. Initialize and
display reverse of that number
10) What do mean by typecasting ? When it is needed ?
11) Write a program to check whether an entered number is prime or not.(2 times)

www.gunwantmankar.com 1
12) Write a program to generate Fibonacci series : 1 1 2 3 5 8 13 21 34 55 89.
13) Write a program to print reverse of a number.

Unit: - II ( Derived Syntactical Constructs in Java) Marks- 1 8

2 Marks Questions:-

1) State use of finalize( ) method with its syntax.


2) Name the wrapper class methods for the following:
(i) To convert string objects to primitive int.
(ii) To convert primitive int to string
objects.
3) Define constructor. List its types
4) Define class and object.
5) Define array. List its types.
6) List access specifiers in Java.

4 Marks Questions:-

1) Explain the types of constructors in Java with suitable example.


2) Define a class student with int id and string name as data members and a method
void SetData ( ). Accept and display the data for five students.
3) Describe instance Of and dot ( . ) operators in Java with suitable example.
4) Explain the four access specifiers in Java
5) Differentiate between String and String Buffer
6) Define a class circle having data members Pi and radius. Initialize and display
values of data members also calculate area of circle and display it
7) Differentiate between array and vector.
8) List any four methods of string class and state the use of each.
9) Differentiate vector and array with any 4 points.
10) Write a program to accept a number as command line argument and print the
number is even or odd.
11) State the use of final keyword w.r.t. a method and the variable with suitable
example.
12) Compare string class and stringBuffer class with any four points.
13) Define a class having one 3 digit number, num as data member, initialize and
display reverse of that number.

www.gunwantmankar.com 2
14) Define constructor. Explain parameterized constructor with example.
15) Describe use of ‘super’ and ‘this’ with respect to inheritance.
16) Write a program to implement following inheritance :

Class : person
name, age

Class :
employee
emp_designation
name, age
emp_salary

17) Define a class Item having data member code and price. Accept data for one
object and display it.
18) Explain use of following methods :
i) indexOf ( ) ii) charAt ( ) iii) subString ( ) iv) repalce ( )
19) What is final variable and method ? How it is different from abstract method ?
20) What is garbage collection and finalize method in Java ?
21) What is constructor ? Describe the use of parameterized constructor with
suitable example.

22) What is the difference between array and vector ? Explain elementAt( )
and addElement( ) method.
23) Explain method overloading with example
24) Describe final method and final variable with respect to inheritance.
25) What is difference between arrays and vectors ? Explain any 2 methods of
vector with example.

26) What is constructor ? Demonstrate the use of parameterised constructor with


suitable example.
27) Explain abstract class with suitable example.
28) State the use of ‘super’ and ‘final’ keyword w.r.t. inheritance with example.

6 Marks Questions:-
1) Describe the use of any methods of vector class with their syntax.
2) Explain the command line arguments with suitable example
3) Write a program to create vector with five elements as (5, 15, 25, 35, 45). Insert
new element at 2nd position. Remove 1st and 4th element from vector.

www.gunwantmankar.com 3
4) Write a program to create a vector with seven elements as (10, 30, 50, 20, 40, 10,
20). Remove element at 3rd and 4th position. Insert new element at 3rd position.
Display the original and current size of the vector.

5) Describe the following string class methods with examples :


(i) length( ) (ii) charAt( ) (iii) CompareTo( )
6) Write a program to implement a vector class and its method for adding and
removing elements. After remove display remaining list.

7) Define a class ‘employee’ with data members empid, name and salary. Accept
data for five objects using Array of objects and print it.
8) Define wrapper class. Give the following wrapper class methods with syntax and use :
i) To convert integer number to string.
ii) To convert numeric string to integer number.
iii) To convert object numbers to primitive numbers using typevalue ( ) method.
9) Explain following methods of vector class :
i) elementAt ( ) ii) addElement ( ) iii) removeElement ( )
10) Explain following methods of string class with their syntax and suitable example.
i) substring ( ) ii) replace ( )
----------------------------------------------------------------------------------------------------------------

Unit: - III ( Inheritance, Interfaces and Packages) Marks- 1 2

2 Marks Questions:-

1) List the types of inheritances in Java.


2) List any four Java API packages

4 Marks Questions:-

1) Explain dynamic method dispatch in Java with suitable example.


2) Differentiate between method overloading and method overriding.
3) Differentiate between class and interfaces.
4) Describe final variable and final method
5) Write the effect of access specifiers public, private and protected in package

www.gunwantmankar.com 4
6) Write a program to implement following hierarchy
Interface: Gross
Class: Emplyee
ta,da, gross_sal ( )
Name, basic_salary()

Class:salary
disp_sal ( ), hra

7) What is package ? How do we create it ?


8) State any four system packages along with their use.

6 Marks Questions:-

1) Explain the concept of Dynamic method dispatch with suitable example


2) Define packages. How to create user defined package? Explain with example.
3) Implement the following inheritance

class: Employee
Interface: Salary
Name, age,
Basic_Salary Display( )
Basic_Sal( )

class: Gross salary


ta, da, hra,
Total_sal( )

4) Explain with example how to achieve multiple inheritance with interface.


5) What is package ? State any four system packages along with their use ? How to
add class to a user defined package ?

6) Write syntax of defining interface. Write any major two differences


between interface and a class.

7) Design a package containing a class which defines a method to find area of


rectangle. Import it in Java application to calculate area of a rectangle.

8) What is interface ? How it is different from class ? With suitable program explain
the use of interface.

9) What is meant by an interface? State its need and write syntax and features of
an interface. Give one example

www.gunwantmankar.com 5
Unit: - IV ( Exception Handling & Multithreading ) Marks- 1 2

2 Marks Questions:-

1) Write the syntax of try-catch-finally blocks


2) Define error. List types of error.

4 Marks Questions:-
1) Explain life cycle of thread.
2) Define exception. State built-in exceptions
3) Explain the two ways of creating threads in Java.
4) Define an exception. How it is handled ?
5) Explain thread priority and method to get and set priority values.
6) With suitable diagram explain life cycle of Thread.
7) Describe life cycle of thread.
8) Describe use of ‘throws’ with suitable example.
9) Explain following methods related to threads :
1) suspend ( ) 2) resume ( ) 3) yield ( ) 4) wait ( )
10) What is exception ? How it is handled ? Explain with suitable example.
11) Explain the following clause w.r.t. exception handling :
(i) try (ii) catch (iii) throw (iv) finally

6 Marks Questions:-
1) Write a program to create two threads. One thread will display the numbers from
1 to 50 (ascending order) and other thread will display numbers from 50 to
1 (descending order).

2) Write a program to input name and salary of employee and throw user
defined exception if entered salary is negative
3) Write a program to create two threads one thread will print even no. between 1 to
50 and other will print odd number between 1 to 50.
4) Write a program to input name and age of a person and throws an user
define exception if entered age is negative.

www.gunwantmankar.com 6
5) What is thread priority ? How thread priority are set and changed ? Explain
with example.

6) Write a program to input name and age of person and throws user
defined exception, if entered age is negative .

7) Write a program to create two threads ; one to print numbers in original order
and other to reverse order from 1 to 50.

8) What are different types of error ? What is use of throw, throws and
finally statement?

9) Write a program to accept password from user and throw ‘Authentication


failure’ exception if password is incorrect.
10) Explain life cycle of thread with aneat diagram.
----------------------------------------------------------------------------------------------------------------

Unit:-V (Java Applets & Graphics Programming) Marks-10

2 Marks Questions:-

1) Give the syntax of < param > tag to pass parameters to an applet.

4 Marks Questions:-

1) Describe the use of following methods: (i) Drawoval ( ) (ii) getFont ( )


(iii) drawRect ( ) (iv) getFamily ( )
2) Differentiate between Java Applet and Java Application ( any four points)
3) Write a syntax and example of (i) drawRect( ) (ii) drawoval( )
4) Explain life cycle of Applet.
5) Write syntax and example of 1) drawString ( ) 2) drawRect ( ) ; 3) drawOval ( )
4) drawArc ( ).
6) Describe following states of applet life cycle :
a) Initialization state. b) Running state. c) Display state
7) State the use of font class. Describe any three methods of font class with their
syntax and example of each.
8) Differentiate applet and application with any four points.
9) State syntax and explain it with parameters for : i)drawRect ( ) ii) drawOral ( )

www.gunwantmankar.com 7
10) Design an Applet program which displays a rectangle filled with red color
and message as “Hello Third year Students” in blue color.
11) Describe applet life cycle with suitable diagram.
12)Differentiate between applet and application (any 4 points).

6 Marks Questions:-
1) Describe the applet life cycle in detail.
2) Explain how to pass parameter to an applet? Write an applet to accept username
in the form of parameter and print “Hello <username>” .
3) Explain <PARAM> Tag of applet with suitable example.
4) State the use of font class. Describe any three methods of font class with their
syntax and example of each.
5) Write a simple applet program which display three concentric circle.
6) Write method to set font of a text and describe its parameters.
7) Write the syntax and example for each of following graphics methods : 1)
drawPoly ( ) 2) drawRect ( ) 3) drawOval ( ) 4) fillOval ( )
8) State the use of Font class. Write syntax to create an object of Font class.
9) Describe any 3 methods of Font class with their syntax and example of each.
10) Write syntax and example of following Graphics class methods : (i) drawOval( )
(ii) drawPolygon( ) (iii) drawArc( ) (iv) drawRect( )

11) Differentiate between applet and application and also write a simple applet
which display message ‘Welcome to Java’ .

How can parameters be passed to an applet ? Write an applet to accept user name in the
form of parameter and print ‘Hello < username >’ .

Unit:-VI (Managing I/O Files in Java) Marks- 08

2 Marks Questions:-
1) Define stream class. List its types.

2) List the methods of File Input Stream Class

www.gunwantmankar.com 8
4 Marks Questions:-
1) Distinguish between Input stream class and output stream class
2) Write a program to count number of words from a text file using stream classes
3) Write a program to copy content of one file to another file.
4) Explain the following classes. (i) Byte Stream Class (ii) Character Stream Class
5) Write any two methods of file and file input stream class each.
6) Write a program to copy contents of one file to another file using character
stream class.
7) What are stream classes ? List any two input stream classes from character stream.
8) What are stream classes ? List any two input stream classes from character stream
9) Explain serialization with stream classes.
10) Explain serialization in relation with stream class.
11) Write syntax and function of following methods of Date class :
i) getTime ( ) ii) getDate ( )
13) State syntax and describe any two methods of map class.
14) Write any four mathematical functions used in Java.
15) What is use of stream classes ? Write any two methods FileReader class.
16) Write syntax and function of following methods of date class :
1) sethme ( ) 2) getDay ( )
17) What is use of setclass ? Write a program using setclass.
18) What are streams ? Write any two methods of character stream classes.
19) Write any two methods of File and FileInputStream class each.
20) What is use of ArrayList Class ? State any three methods with their use
from ArrayList.

21) What is use of Array list class ? State any two methods with their use from
Array List.
22) Explain serialization in relation with stream classes.

6 Marks Questions:-
1) Write aprogram to perform following task.
(i) Create a text file and store data in it.
(ii) Count number of lines and words in that file.

--------------------------------------------------End------------------------------------------------------

www.gunwantmankar.com 9

You might also like