Answered step by step
Verified Expert Solution
Question
1 Approved Answer
if you can give me all answer so that answer my question. give me all answer.make sure the answer is 100% correct thanks in advanced
if you can give me all answer so that answer my question.
give me all answer.make sure the answer is 100% correct
thanks in advanced
1. Which of the following description about the constructor is wrong? ( ) A. The constructor method is a special method of the class, and its method name must be the same as the class name B. The main function of the constructor method is to complete the initialization of the object of the class C. The retun type of the constructor can only be void D. A class can define multiple constructor methods 2. Which of the following statements is correct? A If a non-abstract class is a subclass of an abstract class, then it must override the abstract method of the parent class. B. If an abstract class is a subclass of an abstract class, then it must override the abstract method of its parent class to a non-abstract method. C. The source file cannot have multiple import statements. D. Objects of the parent class can be automatically converted into objects of the child class. If a class named MyObject has no constructors defined explicitly, which of the following constructor is implicitly provided) A. public MyObject B. protected MyObjecto C. private MyObjecto D. MyObjecto 4. Which of the following statements is correct A. The compiler does not prompt the program to use a null object, but a NullPointerException will occur when the program is running 3. B. Method overloading means: There can be multiple methods with the same name in a class, but the parameters of these methods must be different, and the return type must be the same C. A java source file cannot contain multiple main functions. D. The static method in a class cannot be overloaded. 5. Which of the following descriptions is incorrect? O A. The private methods of the parent class cannot be overridden by the subclass. B. Instance variables are shared among objects of the same class. C. The instance variables in the class will be allocated memory space when the object is created with the class. D. Static methods in a class can be called directly with the class name. 6. Which of the following statements is correct? O A. The member variable must be declared in the class body, and then the method is defined B. The declaration of member variables in the class body and the definition of methods can be crossed C. The constructor must be defined in the class body before other methods can be defined D. Instance variables must be defined in the class body before static variables can be defined 7. Class A derives a subclass B, and Class B derives a subclass C. The correct statement for the following Java source code is (). A a0 =new A0; A al =new BO;/12 A a2 =new CO;8/3 A. Only the first line can be compiled B. The statements on lines 1, 2 and 3 are all correct C. The first and second lines can be compiled but the third line fails to compile D. Lines 1, 2 and 3 can be compiled, but errors occur when running on lines 2 and 3 8. For the following E.java code, which of the following statements is correct? O public class E{ public static void main(String args[]){ int [ 1 ]a={{1,2,3,4). (100,200,300},{7.8}}; System.out.println(a[3][0]); } } A. There is a compilation error B. Output 7 C. Compilation is correct, an running exception ArrayIndexOutOfBoundsException occurs D. Output 100 9. Which of the following statement is wrong? ( ) A Static methods can directly access the static variables and static methods of this class B. Static methods can directly access the non-static variables and non-static methods of this class C. Non-static methods can directly access the static variables and static methods of this class D. Non-static methods can directly access non-static variables and non-static methods of this class Which of the following is the correct interface?) A interface A { void printo { }; } B. abstract interface A { printo; } C. abstract interface A abstract void print0 {});} D. interface A { void print0:} 10Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started