You are on page 1of 3

Q.No.

Question Choice 1 Choice 2 Choice 3 Choice 4 Correct Answer


1 _________________ classes cannot be instantiated. Inner Concrete Abstract Wrapper Choice 3
How many objects will be created after executing the
following code?

Class A { Public static void main(String []args)


2 { String s1 = “abc”; String s2 = “abc” String s3 = new 4 3 2 1 Choice 2
String(“abc”); S3.concat(“xyz”); } }

During de-serialization, During


binary stream containing serialization,
During de-serialization,
3 Which of the following statements is NOT true? If super class is serializable, sub-class is state of the object & its transient & static Choice 2
default constructor is
automatically serializable always called corresponding Class data members are
object(Class<T>) are both skipped from
essential serialization

What access control keyword should you use to allow other


do not supply an
4 classes to access a method freely within its package, but to public protected private Choice 4
access control
restrict classes outside of the package from accessing that keyword
method?

5 Which of these is an interface for control over serialization Serializable Externalization FileFilter ObjectInput Choice 2
and deserialization?
6 Which of these classes extend InputStream class? ObjectStream ObjectInputStream ObjectOutput ObjectInput Choice 2

1. Select the most appropriate option for the code below.


1. abstract class A {
2. A() {
3. System.out.print("A");
4. }
5. }
6. class B extends A {
7. B() { Compilation error at line no. Compilation error
7 AB BA Choice 4
8. System.out.print("B"); 2 at line no. 9
9. super();
10. }
11. public static void main(String[] args) {
12. new B();
13. }
14. }

8 How will you sort an array of int? Use Collections.sort() By implementing By implementing Choice 1
Use Arrays.sort() Comparator Comparable
Which among the following collection classes is best suited
9 for implementing a stack without worrying about Vector TreeSet TreeMap ArrayList Choice 4
synchronization?

If an access
A static method in a class is accessible modifier is not
Abstract classes cannot static methods cannot specified
10 Which of the following is NOT true regarding static methods? from within all the member methods Choice 2
of that class have static methods use super keyword on a static method,
it cannot be
accessed from

13
14
15
16
17
18
19
20
21
22
23
24
25
Note : Use Paste Special for copying the data
Choice 1
Choice 2
Choice 3
Choice 4

You might also like