1. Which is not opps concept in Java?
1. Inheritance
2. Encapsulation
Polymorphism
3. Compilation
What is size of int variable?
1. 8 bit
2. 32 bit
3. 64 bit
4. 16 bit
What are return method that doen not return any value?
1. Int
2. Float
3. Char
4. Void
Give:
try(int x = Integer.parseInt(“Two”);)
which could be used to create an appropriate catch block?
1. ClassCastException
2. IllegalStateException
3. NumberFormatException
4. InterruptedException
Which of the following is default value of instance variable?
1. null
2. 0
3. Depends upon the type of variable
4. Not assigned
Page no
6 c (#25 no. qu ha examveda)
7 b default (#19)
8 b object (#40)
9 b private (#24)
10 d Runnable (#37 he purn ahe tase document madhil statement ahe)
11 c The program will print cat (#38 etutorial.org)
12 b super ( #35 sunfoundry)
13 a encapsulation (#33 sunfoundry)
14 d no no (#32)
15 b throws(s ahe bg #7 carrierguide)
16 a collection object (#3 byjus)
17 c public static void main(String[] args] (#4)
There are several ways to define the main method in Java with slight variations in syntax, but they all
serve the same purpose. Here are some of the valid variations:
1. *Standard declaration:*
java
public static void main(String[] args)
2. *Using varargs (variable arguments):*
java
public static void main(String... args)
3. *Modifiers in a different order:*
java
static public void main(String[] args)
4. *Final modifier (though not common, it's valid):*
java
public static final void main(String[] args)
5. *Combinations with varargs and different order:*
java
static public void main(String... args)
The key components that must be present are:
- public
- static
- void
- main
- A parameter that is either String[] args or String... args
Changing the order of public and static or using varargs instead of an array are all acceptable as long
as the essential components are present.
18 b object (#40)
19 b Prints Answer is 3 (#2 )
20 c Prints Clidiet (#17)
21 c final (#6)
22 c (c e f) (#3)
23 b (alpha subsub) (#13)
24 b Prints Answer is 3 (#2 ) ha repeat ahe 19 page same
25 a (Type 4) (#10) mi shikvlele ahe (carrier guide.com)
26 b abstract class ( #11 sunfoundry)
27 c (cef)(#5) page 22 same(#3 pan question same hota
28 d runningrunningrunning (#8)
29 same 28
30 c private, default (#15)
31 c in string (#22) => null is assigned to both “string” and “object” but string is more specific than
object.
32 b compilation error at line 4 b1 ha byte ahe 1 ha int ahe typecast error yetoy same problem asnar
tula final exam la
33 b Boolean (#36) spelling bg boolean cha se yete
34 c object (#14)
35 b (b) (#9)
Here are the statements evaluated:
a) *False*: An abstract class does not need to have any abstract methods. It can be abstract even if
all of its methods have implementations.
b) *True*: An abstract class can have zero or more abstract methods. Even if only one method is
abstract, the class must be declared abstract.
c) *False*: An abstract method cannot have a method body. It only has a declaration and must be
implemented by subclasses.
d) *False*: An abstract class cannot be instantiated directly. It can only be used as a base class for
other classes that provide implementations for its abstract methods.
36 d transient (#34)
37 b wait(), notify, notifyAll() belongs to object class
38 d lang package (#18)
39 a static void dotuff(int… doArgs){}(#12)
40 page 20