
New Java Class Assessment 2
Quiz by Sunil Kumar V
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
When is the object created with new keyword?
 Which of the following is not an OOPS concept in Java?Â
Which of this keyword must be used to inherit a class?
sclass A {
int i;
void display() {
System.out.println(i);
}} class B extends A {
int j;
void display() {
System.out.println(j);
}}
class inheritance_demo {
public static void main(String args[])
{Â B obj = new B();
obj.i=1;
obj.j=2;
obj.display();
}
}
sWhat is the output?
class A
{
public int i;
public int j;
A() {
i = 1;
j = 2;}}
class B extends A {
int a;
B() {
super(); } }
class super_use {
public static void main(String args[])
{
B obj = new B();
System.out.println(obj.i + " " + obj.j)
}
}
All classes in Java are inherited from which class?
In order to restrict a variable of a class from inheriting to subclass, how variable should be declared?
What would be the result if a class extends two interfaces and both have a method with same name and signature? Lets assume that the class is not implementing that method.
 If a class inheriting an abstract class does not define all of its function then it will be known as?
Which of these is not a correct statement?