The Shirpur Education Society’s
R. C. Patel Polytechnic, Shirpur
Department of Computer Science & Engineering
QUESTION BANK CLASS TEST-I
Programme Code: Computer Science & Engg. Year/Scheme: CW-4-I Semester: Fourth
Course Title: Java Programming Course Abbr.: JPR Course Code:22412
Max. Marks:20 Duration:01 Hour Date: 20/02/2024
Q.1. Attempt any FOUR. 4 x 2 = 08M CO-UO
a) Define any four String methods.
b) State syntax of ‘for each’ version of for loop with one example.
c) Define 1) Left shift operator 2) Right shift operator
d) Define constructor.List its types.
e) Define the terms 1)elementAt() 2) addElement()
f) Define dynamic initialization and scope of variables.
Name the wrapper class methods for the following: (i) To convert string objects to
g)
primitive int. (ii) To convert primitive int to string objects.
h) State use of finalize( ) method with its syntax.
i) Define instanceof and dot (.) operators in Java.
Give following methods of string class with their syntax and suitable example.
j)
i) substring ii) replace
k) Define i) Implicit casting ii) Explicit casting
l) Enlist any two logical operators and two bitwise operators.
m) Write down the syntax of array declaration,initialization.
n) Explain any two features of Java.
The Shirpur Education Society’s
R. C. Patel Polytechnic, Shirpur
Department of Computer Science & Engineering
Q.2. Attempt any THREE. 3 x 4 =12M
a) Explain the command line arguments with suitable example.
b) Define constructor.Explain parameterized constructor with example.
Define a class circle having data members Pi and radius. Initialize and display values
c)
of data members also calculate area of circle and display it.
d) Define garbage collection in Java?Explain final method in Java
Write a Java program to implement following functions of string:
e)
i) Calculate length of string ii) Compare between strings
f) Differentiate between String and String Buffer.
g) Give any four difference between array and vector.
h) Explain any four visibility controls in Java.
i) Write a program to display ASCII value of a number 9.
j) Write a program to sort the elements of an array in ascending order.
k) Explain implicit and explicit type conversion with example in detail.
l) Explain vector with the help of example.Explain any 2 methods of vector class.
Write a program to print the sum,difference and product of two complex numbers by
m) creating a class named “Complex” with separate methods for each operation whose
real and imaginary parts are entered by user.
n) Explain switch case and conditional operator in java with suitable example.
Write a program to add 2 integer, 2 string and 2 float values in a vector. Remove the
o)
element specified by the user and display the list.
* * *Best of Luck* * *