Java Quiz V1
Java Quiz V1
A) JDK is required to run Java programs, JRE is used for compiling Java code.
D) == is used only for primitive types, while .equals() is used for objects.
B) The mechanism where one class inherits the fields and methods of
another class.
Answer: B) The mechanism where one class inherits the fields and methods
of another class.
7. What is polymorphism in Java?
A) The ability to write Java code that can run on multiple devices.
B) The concept of defining methods in a class that have the same name but
different implementations.
Answer: B) The concept of defining methods in a class that have the same
name but different implementations.
B) A type that defines a contract for methods, but does not provide their
implementation.
Answer: B) A type that defines a contract for methods, but does not provide
their implementation.
D) ArrayList and LinkedList are the same and can be used interchangeably.
Answer: A) ArrayList is backed by a dynamic array, while LinkedList is backed
by a linked list.