Dce 515

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Date:09/05/2017 Enrolment No.

:___________________

RK UNIVERSITY
D.ENGG./SEM-IV/REGULAR/MAY-2017

DCE515: JAVA PROGRAMMING

Time: 09:00 AM TO 12:00 PM Total Marks: 100

Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
4. Programmable calculator is not permissible.

SECTION – I

Q.1 (a) Give the appropriate answer from the following questions: 10
1. Which operator is used to concatenate two or more string?
(a) + = = (b) + (c) || (d) ^^
2._______________is collection of classes and interfaces.
(a) package (b) java (c) memory (d) object
3. Which of the following is not primitive data type?
(a) bytes (b) boolean (c) double (d) string
4. What is the environment variable that contains a list of
directories where java looks for classes referenced in a
program?
(a) CLASSPATH (b) PATHFLOW
(c) PATHCLASS (d) PATHSEARCH
5. Which of the following access specifies is usually used with
inheritance.
(a) public (b) private
(c) protected (d) package
6. ____________is selective statement in Java.
(a) continue (b) if (c) for (d) break
7._______________is a reference to current object on which the
method was invoked. (fill the blanks)
8.Constructor with no parameter is called a__________
constructor. (fill the blanks)
9. The first element in an array is accessed using zero as an
index. (True/False)
10. Output of the Java compiler is known as dalvik opcode.
(True/False)

Page 1 of 3
(b) List out all features of Java and explain general structure of 06
Java program.

Q.2 (a) Explain following (1) java virtual machine (JVM) 06


(2) while loop
(b) Explain recursion in java with example. 05
(c) Explain in short (1) This keyword. (2) Garbage collection. 05
OR
Q.2 (a) What is class and object? Write general form of declaring class 06
and object.
(b) Explain static and final keyword with syntax. 05
(c) Explain nested class with example. 05

Q.3 (a) List out types of constructor and explain parameterized 06


constructor with example.
(b) Explain type casting and type conversion. 06
(c) What is inheritance? Explain multilevel inheritance with 06
example.
OR
Q.3 (a) Explain method overriding with example. 06
(b) What is package? Develop a java program to create a package 06
and demonstrate that how packages are used in java.
(c) Explain in short various string functions. 06
(1) Concat( ) (2) append( ) (3) IndexOf( )

SECTION – II

Q.4 (a) State whether the following statements are true or false. 10
1. Compile time exceptions can be handled using throws
keyword.
2. To put controls in the form of rows and columns,
GridLayout can be used.
3. MouseListener is an interface for ActionEvent.
4. Applet contains main() method in its life cycle.
5. In Exception, finally block is compulsory.
6. In panel, we can’t set layout.
7. To draw rectangle, drawOval() can be used.
8. To call paint() method of Graphics class, repaint() is
used.
9. To create new applet window, we can use Frame class
in java.
10. We can’t generate more than one exceptions in single
program.
Page 2 of 3
(b) Differentiate checked and unchecked exception. Write a 06
program to generate ArithmeticException.

Q.5 (a) Why do we need layouts in java? List all types of layouts and 06
explain any two with an example.
(b) Differentiate Error and Exception. Write a program to 05
generate and handle ArrayIndexOutOfBoundsException.
(c) Differentiate application and applet. 05
OR
Q.5 (a) 1) Explain life cycle of thread. 06
2) Explain life cycle of an applet with an appropriate example.
(b) Write a program which shows any five controls within applet. 05
(c) Explain the concept of user defined exception with an 05
example.

Q.6 (a) Write a program to place a TextField and a Button in applet. 06


When user clicks on button, any kind of text needs to be set on
TextField.
(b) Write an applet program to draw an object like house. 06
(c) How can we create thread in java? Explain with suitable 06
example.
OR
Q.6 (a) What is the use of Panel? Explain with an appropriate 06
example.
(b) Write an applet program to draw an object like star. 06
(c) Write an applet program that shows use of CheckBox in 06
applet.

*************

Page 3 of 3

You might also like