1.
Find the output of the following code. if(1 + 1 + 1 + 1 + 1 == 5){ System.out.print(“TRUE”); } else{ System.out.print(“FALSE”); }
2.
Identify the corrected definition of a package
4.
Number of primitive data types in Java are?
5.
Total constructor string class have?
6.
How many objects will be created in the following? String a = new String(“Block Chain”); String b = new String(“Block Chain”); String c = “Block Chain”; String d = “Block Chain”;
7.
When an array is passed to a method, what does the method receive?
8.
Select the valid statement.
9.
Identify the infinite loop.
10.
What is the implicit return type of constructor?
11.
Identify the correct restriction on static methods. 1 They must access only static data 2 They can only call other static methods. 3 They cannot refer to this or super.
12.
Automatic type conversion is possible in which of the possible cases?
13.
Identify the modifier which cannot be used for constructor. *
14.
Identify the keyword among the following that makes a variable belong to a class, rather than being defined for each instance of the class.
15.
When is the object created with new keyword?
16.
Where does the system stores parameters and local variables whenever a method is invoked?
17.
Identify what can directly access and change the value of the variable res. Public class Solution{ Private int res = 100; }
18.
Find the output of the following code. int ++a = 100; System.out.println(++a);
19.
Identify the output of the following program. String str = “abcde”; System.out.println(str.substring(1, 3));
20.
What is the size of float and double in java?