Testing test on JAVA P2
24 May 2019
Multiple choice questions on Java programming help you test your basic knowledge of this programming language. The set of questions includes 10 sentences to try.
Question 1. When the compiler encounters an Exception error in the main thread java.lang.NoClassDefFoundError: myprogram. What does this error mean?
There is no main function
There is no public keyword at the beginning of class declaration
Question 2. What is the object in the software?
Is a bundle of software that consists of related behaviors and states
Is a defining object of the real world
An object consisting of behavior and state
Objects that are represented in software include 2 data field attributes and data processing methods
Question 3. Which of the following is correct?
protected inner class engine {}
Question 4. Which of the following is incorrect?
Question 5. How many main methods will there be in a 2-class program?
Question 6. How many parent classes can a class in Java have?
Question 7. How many subclasses does a class in Java have?
Question 8. How do I declare Xedap1 class to inherit Xedap class?
class Xedap1 extend Xedap {}
public classs Xedap1 extend Xedap {}
class Xedap1 extends Xedap {}
Question 9. Choosing the best answer What is interface?
A class containing related empty methods
A reference type, similar to a class, can only contain value constants, method declarations and nested types
Is an implementation method of another class
Is the connection layer between the base class and the parent class
Question 10. To use the Xedap interface for class Xedap1, how do we do it?
class Xedap1 implement Xedap {}
public class Xedap1 implement Xedap {}
class Xedap1 implements Xedap {}
public class Xedap1 extends Xedap {}