This is a Java programming language quiz. Take this practice quiz and learn more codings of java.
A. public class Circle extends Shape { private int radius; public void draw();}
B. public abstract class Circle extends Shape { private int radius;}
Public class Circle extends Shape { private int radius; public void setRadius(int radius) { this.radius = radius; } public int getRadius() { return radius; } public void draw() {/* code here */}}
public class Circle implements Shape { private int radius;}
Public class Circle extends Shape { public int radius; private void draw() {/* code here */} }
Inheriting from two super classes
Inheriting from a class which is already in an inheritance hierarchy
Inheriting from more than one super class
Inheriting from a single class
Rate this question:
Prints: false
Runtime error: NullPointerException
Compilation error: cannot find the symbol
Compilation error: v is not initialised inside the constructor
Prints: true
Rate this question:
A. 0 1 2 3 4 5
B. Indefinite Loop
C. 1 2 3 4 5
D. 0 1 2 3 4
E. 0 1 2 3 4 0 1 2 3 4
Rate this question:
A. Class: Real Chocos Private Limited Objects: Chocolate
B. Class: Fruit Chocolates Objects: Rum Chocolates
C. Class: Chocolate Objects: Fruit Chocolates, Rum Chocolates, Milk Chocolates
D. Class: Choclate Objects: Milk Chocolates
Rate this question:
A. public void add(B b) { b.getValue(); }
B. public void add(A a) { a.getValue(); }
C. public void add(C c1, C c2) { c1.getValue(); }
D. public void add(C c) { c.getValue(); }
E. public void add(A a, B b) { a.getValue(); }
Rate this question:
A. it is a 32 bit numeric digest key
B. the numeric key is unique
C. hashCode() value cannot be a zero-value
D. It improves performance
E. hashCode() is defined in String class
Rate this question:
A. Java Virtual Machine (JVM)
B. Java Source Files
C. Java Development Kit (JDK)
D. Java Class Files
E. JAR Files
Rate this question:
A-II, B-III, C-I
A-III, B-II, C-I
A-I, B-II, C-III
A-II, B-I, C-III
Rate this question:
Both the length() methods are duplicated methods
Both the length() methods are overloaded methods
Overloaded methods cannot start with a special character like '_'
Overloaded methods should be declared as public
Compile time error
Prints: 40
Prints: 50
Run time error
Rate this question:
1,2,3
2,3,4
3,4,5
1,3,5
1,3,4
Rate this question:
Helps the compiler to find the source file that corresponds to a class, when it does not find a class file while compiling
To maintain the uniform standard
Helps Javadoc to build the Java Documentation easily
Rate this question:
Classes can be loaded at Runtime, without actually referring the class in the code at compile time.
Classes can be loaded at Runtime, but the name of the class with full package name should be given in the code at compile time.
Classes cannot be loaded at Runtime
Only class that is loaded at runtime is the class that contains the main() method
Rate this question:
Declaration 1,3,4
Declaration 2,4
Declaration 1,2,3
Declaration 2,3,4
Rate this question:
Both Statements A and B are true
Statement A is false and B is true
Statement A is true and B is false
Both Statements A and B are false
Rate this question:
2,4
1,2
2,3
3,4
Rate this question:
Zippo
An exception occurs at runtime at line 10.
Compilation fails because of an error in line 3.
Compilation fails because of an error in line 9.
Compilation fails because of an error in line 10.
Rate this question:
Outer.Inner o = new Outer.Inner();
Outer.Inner oi = new Inner();
"Outer o = new Outer(); Outer.Inner oi = o.new Outer.Inner();"
Inner oi = new Outer.Inner();
Rate this question:
Quiz Review Timeline (Updated): Mar 22, 2023 +
Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.
Wait!
Here's an interesting quiz for you.