Java test (Huawei)-New

Source: Internet
Author: User

I. Single-choice questions
1. Java is re-designed from the () language.
A. ADA B .C ++ C. pasacal D. Basic
Answer: B
  
2. Which of the following statements is true ()
A. After the Java program is compiled, the machine code is generated.
B. After the Java program is compiled, byte code is generated.
C. After the Java program is compiled, the DLL
D. None of the above are correct.
Answer: B
  
3. Which of the following statements are true ()
A. constructor in class cannot be omitted
B. the constructor must have the same name as the class, but the method cannot have the same name as the class.
C. constructor is executed when an object is new.
D. One class can only define one Constructor
Answer: c
  
4. The package that provides Java database access capabilities is ()
A. java. SQL B. java. AWT C. java. Lang D. java. Swing
Answer:
  
5. Which of the following operators is valid ()
A. & B. <> C. If D.: =
Answer:
  
6. Execute the following program code:
A = 0; C = 0;
Do {
-- C;
A = A-1;
} While (a> 0 );
The value of C is ()
A.0 B .1 C.-1 D. endless loop
Answer: c
  
7. Which of the following statements is true ()
A. Abstract modifiers can be used to modify fields, methods, and classes.
B. The body part of the abstract method must be wrapped in a pair of braces {}
C. Declare the abstract method. Braces are optional.
D. Do not write braces for declaring Abstract METHODS
Answer: d
  
8. Which of the following statements is true ()
A. Formal parameters can be considered as local variable
B. Formal parameters can be modified by field Modifiers
C. Formal parameters are actually transmitted parameters when a method is called
D. The form parameter cannot be an object
Answer:
  
9. Which of the following statements is true ()
A. the instance method can directly call the superclass instance method.
B. The instance method can directly call the superclass class method.
C. The instance method can directly call the instance methods of other classes.
D. The instance method can directly call the class methods of this class.
Answer: d
  
Ii. multiple choice questions
1. Java program types ()
A. Class B. Applet C. Application D. servlet
2. Which of the following statements are true ()
A. environment variables can be specified during source code compilation
B. The environment variables that can be specified during program compilation do not include the class path
C. javac can compile several Java source files at a time.
D. javac.exe can specify the directory in which the compilation result will be placed)
Answer: BCD
  
3. Which of the following identifiers is invalid ()
A. New B. $ usdollars c.1234 D. Car. Taxi
Answer: ACD
  
4. Which of the following statements are false ()
A. array is an object.
B. arrays belong to a native class
C. Int number = [] = {31,23, 33,43, 35,63}
D. The array size can be changed at will.
Answer: BCD
  
5. interfaces that cannot be modified are ()
A. Private B. Public C. Protected D. Static
Answer: ACD
  
6. Which of the following statements are true ()
A. Call by value does not change the actual parameter value.
B. Call by reference can change the reference address of the actual parameter.
C. Call by reference cannot change the reference address of the actual Parameter
D. Call by reference can change the actual parameter content
Answer: ACD
  
7. Which of the following statements are false ()
A. Use this in class methods to call class methods of this class.

B. You can call this class method directly when calling this class method in class methods.
C. Only class methods in this class can be called.
D. The instance method cannot be called in class methods.
Answer: ACD
  
8. Which of the following statements are false ()
A. Java object-oriented language allows separate processes and functions to exist
B. Java object-oriented language allows separate methods to exist
C. Methods in Java belong to members of the class (member)
D. Methods in the Java language must belong to a certain class (object), and the calling method and process or function must be the same
Answer: ABC
  
9. Which of the following statements are false ()
A. The main () method is required for Java class files that can be successfully run by java.exe.
B. j2sdk is a Java API
C. appletviewer.exe you can use the jar option to run the. jar file.
D. The main () method is required for Java class files that can be successfully run by appletviewer.
Answer: BCD
  
Iii. Answer questions
1. The name of the starting class in the Java program must be the same as the name of the file where the class is stored. ()
Answer: Correct
  
2. Unicode represents a word in 16 bits. ()
Answer: Correct
  
3. Data Types in the native class can be converted at will. ()
Answer: Error
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.