Question Bank Class Test 1 JPR 2023-24
Question Bank Class Test 1 JPR 2023-24
b) State syntax of ‘for each’ version of for loop with one example.
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.
Give following methods of string class with their syntax and suitable example.
j)
i) substring ii) replace
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.
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* * *