2016 Lenovo school recruit software development online test real problem

Source: Internet
Author: User
Tags c constructor call by reference access database lenovo

One, Single choice questions

1. Java is redesigned from () language improvements.

A Ada B. C + +. Pasacal D. BASIC

Answer: B this question is not difficult, although I only know C + +, the teacher also only take Java and C + + comparison.

ADA: A language invented by the U.S. military to integrate systems developed in different languages, the biggest feature is real-time, with object-oriented content added to the ADA95.

Pascal: The language that is invented for the promotion of structured programming, the structural features are very obvious, the function body allows arbitrary levels of nesting.

BASIC: In order to make it easy for college students to control the language of computer development, features are simple and understandable, and can be interpreted and compiled in two ways to execute.

2. Which of the following statements is correct ()

A The Java program will generate machine code after compiling.

B The Java program generates a byte code after it is compiled

C A Java program compiles a DLL after it has been compiled

D None of the above is correct

Answer: B

. The Java file is Javac compiled into a. class suffix byte-code file, which is then executed by the JVM.

3. The following statements are correct ()

A The constructor in class must not be omitted

B Constructor must have the same name as class, but the method cannot have the same name as class

C constructor is executed when an object is new

D A class can only define one constructor

Answer: C

Constructor both constructors, Java provides a default empty constructor, so you can omit. constructor must have the same name, constructor can be overloaded.

4. The package that provides the Java Access database capability is ()

A java.sql B. java.awt C. Java.lang D. Java.swing

Answer: A

Java.swing is a package of graphics development components. java.awt contains some old graphics components, Java.lang are generic classes that are included by default. java.sql contains an API for manipulating databases to get data

5. The following operations are in accordance with the law ()

A && B. <> C. If D. :=

Answer: A

<> is the syntax in SQL, java with! =

6. Execute the following program code

a=0;c=0;

do{

--c;

A=a-1;

}while (a>0);

After, the value of C is ()

A 0 B. 1 C. -1 D. Dead loop

Answer: C

7. Which of the following statements is true ()

A The abstract modifier modifies fields, methods, and classes

B The body part of the abstract method must be wrapped in a pair of curly braces {}

C Declaring abstract methods, curly braces are optional

D Declaring abstract methods cannot write curly braces

Answer: D

Abstract cannot modify a field, it is not implemented, and cannot be used with {}.

8. The following statements are correct ()

A Formal parameters can be considered as local variable

B Formal parameters can be decorated with field modifiers

C The parameters that are actually passed when the formal parameter is called by the method

D Formal parameters can not be objects

Answer: A

Real arguments are passed, parameters can be objects, and references are passed at the time of the object.

9. Which of the following statements is true ()

A Instance methods can directly call an instance method of a superclass

B Instance methods can call class methods of super class directly

C Instance methods can call instance methods of other classes directly

D Instance methods can call the class method of this class directly

Whether the subclass can call the parent class to see the permissions of the corresponding method of the parent class, regardless of the permissions of the method of this class, can be called.

Answer: D

Second, multiple choice questions

1. Types of Java programs have ()

A Class B. Applet C. Application D. Servlet

Answer: B,c,d

Applets: (small applications) are HTML-based programs created in Java. The browser temporarily downloads it to the user's hard disk and runs locally when the Web page opens. Generic applets can only be run by appletviewer or browsers, and Java programs may embed Web pages by inheriting applet classes.

Servlet (Server Applet), full name Java Servlet, without Chinese translation. is a server-side program written in Java. Its main function is to interactively browse and modify data to generate dynamic Web content.

2. The following statements are correct ()

A Environment variables can be specified when compiling source code

B When compiling the program, the environment variables you can specify do not include the class path

C Javac can compile several Java source files at a time

D Javac.exe can specify which directory the compilation results are to be placed in (directory)

Answer: BCD

3. The following identifiers are not valid ()

A New B. $Usdollars C. 1234 D. Car.taxi

Answer: ACD

Java naming rules: the uppercase and lowercase letters, numbers, underscores "_" and the dollar Sign "$", and the first digit cannot be a number.

4. The following statements are wrong ()

A An array is an object

B Arrays belong to a native class

C int number=[]={31,23,33,43,35,63}

D The size of the array can be arbitrarily changed

Answer: BCD

A primitive class refers to a class that is not instantiated, an array generally refers to an instantiation, a class that is allocated space, not a native class.

5. Can not be used to modify the interface ()

A Private B. Public C. Protected D. Static

Answer: ACD

Class available modifier has public final abstract (final and abstract not available), interface only public (interface is abstract)

6. The following are correct ()

A Call by value does not change the value of the actual parameter

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 contents of the actual parameters

Answer: ACD

A numeric copy does not change the actual parameter content, and the reference copy can change the argument content, but does not change the reference address of the argument.

7. The following statements are wrong ()

A This is used in class methods to invoke class methods of this class

B Calling the class method of this class in a class method can be called directly

C Only class methods in this class can be called in a class method

D An instance method must never be called in a class method

Answer: ACD

This is a reference to the current class object and cannot be used to invoke a class method. A class method cannot call a non-static method, which is called after the class is instantiated for direct invocation of this class of methods.

There are loopholes in the problem, the actual attempt to find that the class method can be called directly, but there will be a compiler warning, in theory, the class method is common to the class, the instance can also be accessed, but generally use the class name to display the call.

public class Main {
public void print ()
{
System.out.println ("print");
}
public static void Main (string[] args)
{
Main S=new main ();
S.print ();

}

}

8. The following statements are wrong ()

A Java object-oriented language allows individual processes and functions to exist

B Java object-oriented language allows separate methods to exist

C Methods in the Java language belong to members in a class (member)

D Methods in the Java language must be subordinate to a class (object), and the calling method is the same as a procedure or function

Answer: ABC

This is a word game, no meaning, let me choose I will choose AB

9. The following statements are wrong ()

A Java class files that can be successfully run by Java.exe must have a main () method

B J2SDK is the Java API

C Appletviewer.exe can run the. jar file with the JAR option

D Java class files that can be successfully run by Appletviewer must have a main () method

Answer: BCD

This is not very understand, only know the applet as long as inherit the applet class on the line, do not need the main () method, the others do not know ...

Three, the judgment question

1. The starting class name in a Java program must be the same as the file name that holds the class. ()

Answer: Right

2. Unicode is a 16-bit representation of a word. ()

Answer: Right

3. The data types in the native class can be arbitrarily converted. ()

Answer: Error


Transferred from: http://www.cnblogs.com/Moon-Face/archive/2010/11/10/1873878.html

This article is from the "Squirrel" blog, please be sure to keep this source http://apinetree.blog.51cto.com/714152/1701760

2016 Lenovo school recruit software development online test real problem

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.