Font size
WorksheetsJava OOP
Total questions: 10
Worksheet time: 5mins
Composition is a
uses-a relationship
has-a relationship
is-a relationship
none of the above
What is not a Java primitive data type?
float
byte
Boolean
char
Which is not a valid way to define an array?
int[3] i = new int[];
int[ ] i = {1,2,3};
int[ ] i = new int[ ]{1, 2, 3};
int[ ] i = new int[3];
Select the access level/s of a private modifier.
Class
Package
Subclass
World
It keeps the data and the code safe from external interference.
Polymorphism
ArrayList
Autoboxing
Encapsulation
Which data type is not supported by ArrayList?
Integer
String
double
Boolean
What is an instance of a class?
Class
Object
Reference
Primitive
Autoboxing converts primitive to corresponding object wrapper class
true
false
What is the default value of a primitive int data type?
-1
null
0
garbage data
Consider the given code. What would be the display on the screen?
Class A
Class B
Class C
Compile error
