MCQ Practice Set 1
MCQ Practice Set 1
Data Security
Data Functionality
Method Security
None of these
2. Subclass is also known as _________.
Superclass
Base Class
Target
None of these.
3. A class can have only _________ access specifier.
Private
Public
Protected
All of these
4. Class is a _________ data type.
Primitive
Composite
Singleton
Explicit
5. Determine the type of casting for int a='A’;
implicit
Explicit
Composite
All of these
6. Which of the following option leads to the portability and security of Java?
Bytecode is executed by JVM
Use of exception handling
Dynamic binding between objects
None of these.
7. What will be the output of the following program?
String s1=” “;
String s2=”APPLE”;
int n=s1.compareTo(s2) ;
5
65
0
-65
24
23
20
25
Complete
Iomplede
Cimpletd
Coipletd
19. Output of Math.rint(18.88) is _______.
19
18
18.00
20
20. Given,
ArrayList list = new ArrayList();
What is the initial quantity of the ArrayList list?
5
10
0
100