0% found this document useful (0 votes)
55 views

java

Java pdf

Uploaded by

tborade94
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

java

Java pdf

Uploaded by

tborade94
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

22412

21222
3 Hours / 70 Marks Seat No.
15 minutes extra for each hour

Instructions – (1) All Questions are Compulsory.


(2) Answer each next main Question on a new page.
(3) Illustrate your answers with neat sketches wherever
necessary.
(4) Figures to the right indicate full marks.
(5) Assume suitable data, if necessary.
(6) Mobile Phone, Pager and any other Electronic
Communication devices are not permissible in
Examination Hall.
Marks

1. Attempt any FIVE of the following: 10


a) Enlist the logical operators in Java.
b) Give the syntax and example for the following functions
i) min ( )
ii) Sqrt ( )
c) Define the interface in Java.
d) Enlist any four inbuilt packages in Java.
e) Explain any two methods of File Class.
f) Write syntax of elipse.
g) Enlist any four compile time errors.

P.T.O.
22412 [2]
Marks
2. Attempt any THREE of the following: 12
a) Explain any four features of Java.
b) Write a Java program to copy the content of one file into
another.
c) Write the difference between vectors and arrays. (any four
points)
d) Explain exception handling mechanism. w.r.t. try, catch, throw
and finally.

3. Attempt any THREE of the following: 12


a) Write a Java program to find out the even numbers from
1 to 100 using for loop.
b) Explain any four visibility controls in Java.
c) Explain single and multilevel inheritance with proper example.
d) Write a java applet to display the following output in Red
color. Refer Fig No. 1.

Fig No. 1.

4. Attempt any THREE of the following: 12


a) Explain switch case and conditional operator in java with
suitable example.
b) Draw and explain life cycle of Thread.
c) Write a java program to sort an 1-d array in ascending order
using bubble-sort.
d) Explain how to create a package and how to import it.
e) Explain
i) drawLine
ii) drawOval
iii) drawRect
iv) drawArc
22412 [3]
Marks
5. Attempt any TWO of the following: 12
a) How to create user defined package in Java. Explain with
an suitable example.
b) Write a Java program in which thread A will display the
even numbers between 1 to 50 and thread B will display
the odd numbers between 1 to 50. After 3 iterations thread
A should go to sleep for 500 ms.
c) What is constructor? List types of constructor. Explain
paramaterized constructor with suitable example.

6. Attempt any TWO of the following: 12


a) Write a Java program to count the number of words from a
text file using stream classes.
b) Explain the difference between string class and string buffer
class.
Explain any four methods of string class.
c) Write a Java applet to draw a bar chart for the following
values.
Year 2011 2012 2013 2014
Turnover
110 120 170 160
(Rs. crores)
22412
22223
3 Hours / 70 Marks Seat No.

Instructions – (1) All Questions are Compulsory.


(2) Answer each next main Question on a new page.
(3) Illustrate your answers with neat sketches wherever
necessary.
(4) Figures to the right indicate full marks.
(5) Assume suitable data, if necessary.
(6) Mobile Phone, Pager and any other Electronic
Communication devices are not permissible in
Examination Hall.

Marks

1. Attempt any FIVE of the following: 10


a) Define the terms with example
i) Class
ii) Object
b) Enlist any two access specifier with syntax.
c) Give a syntax to create a package and accessing package in
java
d) Give a syntax of following thread method
i) Notify ( )
ii) Sleep ( )
e) Give a syntax of 〈param〉 tag to pass parameters to an applet.
f) Define stream class and list types of stream class.
g) Give use of garbage collection in java.

P.T.O.
22412 [2]
Marks
2. Attempt any THREE of the following: 12
a) Describe type casting in java with example.
b) Differentiate between string and string buffer class
(any four points)
c) Write a program to create a user defined exception in java.
d) Write a program for reading and writing character to and from
the given files using character stream classes.

3. Attempt any THREE of the following: 12


a) Write a program to print all the Armstrong numbers from
0 to 999.
b) Explain the applet life cycle with neat diagram.
c) Describe the package in java with suitable example.
d) Enlist types of Byte stream class and describe input stream
class and output stream class.

4. Attempt any THREE of the following: 12


a) Describe any four features of java.
b) Explain any four methods of vector class with example.
c) Describe interface in java with suitable example.
d) Write an applet program for following graphics method.
i) Drawoval ( )
ii) Drawline ( )
e) Enlist any four methods of file input stream class and give
syntax of any two methods.
22412 [3]
Marks
5. Attempt any TWO of the following: 12
a) Write a program to copy all elements of one array into
another array.
b) Write a program to implement the following inheritance.
Refer Fig. No. 1.

Fig. No. 1
c) Write a program to print even and odd number using two
threads with delay of 1000ms after each number.

6. Attempt any TWO of the following: 12


a) Explain thread life cycle with neat diagram.
b) Write a program to generate following output using
drawline ( ) method. Refer Fig. No. 2.

Fig. No. 2
c) Explain constructor with its type. Give an example of
parameterized constructor.
22412
23124
3 Hours / 70 Marks Seat No.

Instructions – (1) All Questions are Compulsory.


(2) Answer each next main Question on a new page.
(3) Illustrate your answers with neat sketches wherever
necessary.
(4) Figures to the right indicate full marks.
(5) Assume suitable data, if necessary.
(6) Mobile Phone, Pager and any other Electronic
Communication devices are not permissible in
Examination Hall.

Marks

1. Attempt any FIVE of the following : 10


a) Enlist any two logical operators and two bitwise operators.
b) Define constructor.
c) Write down the syntax of array declaration, initialization.
d) List out different ways to access package from another package.
e) Differentiate between starting thread with run (  ) method and
start (  ) method.
f) State the classes that can an applet extend.
g) Give syntax to open a file using Inputstream class.

P.T.O.
22412 [2]
Marks
2. Attempt any THREE of the following : 12
a) Write a program to display ASCII value of a number 9.
b) Write a program to sort the elements of an array in ascending
order.
c) Define Thread. Draw life cycle of Thread.
d) Write a program to read a file and then count number
of words.

3. Attempt any THREE of the following : 12


a) Write a program which displays functioning of ATM machine,
(Hint : Withdraw, Deposit, Check Balance and Exit)
b) Differentiate between method overloading and method overriding.
c) Explain applet life cycle in detail.
d) Differentiate between Byte Stream Class and Character Stream
Class. (Any four points)

4. Attempt any THREE of the following : 12


a) Explain implicit and explicit type conversion with example
in detail.
b) Write a program to show the use of copy constructor.
c) Write a program to show the Hierarchical inheritance.
d) Explain any four font methods with example.
e) Write a program to append content of one file into
another file.
22412 [3]
Marks
5. Attempt any TWO of the following : 12
a) Explain vector with the help of example. Explain any 3 methods
of vector class.
b) Develop and Interest Interface which contains Simple Interest
and Compound Interest methods and static final field of rate
25%. Write a class to implement those methods.
c) Write a program that throws an exception called
“NoMatchException” when a string is not equal to “India”.

6. Attempt any TWO of the following : 12


a) Write a program to print the sum, difference and product of
two complex numbers by creating a class named “Complex”
with separate methods for each operation whose real and
imaginary parts are entered by user.
b) i) Explain Errors and its types in detail.
ii) Explain thread methods to set and get priority.
c) Write a program to draw a chessboard in Java Applet.

You might also like