Quiz 7 Flashcards
(10 cards)
T/F
When there is a method overloading in Java, the method that gets called is always determined at run-time based on the method signature.
False
In Java, all classes inherit from the _______________ class by default.
Map
Iterable
List
Object
Object
T/F
Java does not support operator overloading.
True
T/F
Simula is the first purely object-oriented language. Everything in Simula is an object, including numbers and code itself.
False
T/F
Constructors in Java must have a return type of void.
False
T/F
In Java, an interface can extend other interfaces using the extends keyword.
True
T/F
Java supports multiple inheritance, meaning a class can inherit from more than one base class.
False
T/F
What is the output of the following Java code:
String a = new String(“hello”);
String b = new String(“hello”);
System.out.println(a == b);
False
What is the output of the following code:
class A{
public void p(){
System.out.println(“1”);
}
public void q(){
System.out.println(“2”);
}
public void r(){
p();
}
}
class B extends A{
public void p(){
System.out.println(“3”);
}
}
class C extends B{
public void q(){
System.out.println(“4”);
}
}
public class QuizMain {
public static void main(String[] args) {
A a = new C();
a.r();
}
}
2
4
3
1
3
Which of the following class does not implement List interface in Java?
Vector
LinkedList
ArrayList
HashSet
HashSet