Worksheetsoops and inheritance
Total questions: 15
Worksheet time: 8mins
What is the default value of Boolean variable?
TRUE
FALSE
NULL
NOT DEFINED
Default value of static integer variable of a class in java is
(a)
Java is short of Javascript.
TRUE
FALSE
Which feature JAVA does not support?
Polymorphism
Inheritance
Pointer
Portable
Which method can used to find the length of string?
stringlength()
length()
getLength()
getSize()
How to create anonymous Objects
new Class_name().method_name();
Obj=new Class_name().method_name();
Class_name obj=new Class_name().method_name();
new Class_name().objname
How to create nested class object for the following code______
Ex:
class A
{
Class B//nested class
{
}
}
A r=new A();
A.B c=new A.B();
A r=new A();
A.B c=r.new A.B();
A r=new A();
B c=new A.B();
A r=new A();
B c=new B();
A java program allows any number of public classes with in a single program
True
False
What is garbage Collection
It is the process of collecting unused memory
It is used to create class in dynamic memory
It is a type of static memory
None of these
Static blocks are executed after main() function execution..
True
False
Which of the following is not a feature of static method
Static methods access only other static methods
Static methods must allow static variables.
A static method can access with class name
A static method calls non-static methods.
What is the feature of static variable in JAVA
All objects share the memory of static variables
We can access static variables directly with class name
we can access static variables directly without class and object(separate classes)
static variables are constants in java
What is class in OOP_______________
It is a collection of objects of similar type
It is used to write object code
It is a collection of structures.
It is a blue print of object
Which of the following is not a feature of OOP in C++?
Encapsulation
Abstraction
Inheritance
Compilation
Which of the following syntax is used to create Object in Java
Class_name obj_name=new Class_name();
Class_name Obj_name=new Class_name;
Obj_name=new Class_name();
class_name=new Object_name();
