<> Zero , Single choice

* Which of the following is not Java Keywords for ?
A. class
B. package
C. Void
D. static
Answer and analysis : This question is about Java Keywords for ,Java Language is case sensitive , therefore Void Not a keyword ,void actually is .

* What's wrong about data types is that ?
A. Data type is divided into basic data type and reference data type
B. Arrays belong to the basic data type
C. Class is of reference data type
D. int and double It belongs to the basic data type
Answer and analysis : This question examines the content of data types ,ACD Options are the right word for data types ,B The description of the option is incorrect , Array is of reference data type .

* Which of the following is not legal int Representation of type literals ?
A. 0x34
B. 026
C. 1000
D. 0x23dfL

Answer and analysis : This paper examines the representation of integer letter values , The literal value of an integer can be binary , decimal system , Octal and hexadecimal .A Options are hexadecimal ,B The options are octal ,C Options are decimal ,D option 0x23dfL At the end L, Represents the literal value of a long integer , no int Type literal value .

* The output of the following statement is ? int x=56; System.out.println("x="+x);
A. x=x
B. x=56
C. 56=56
D. 56=x

Answer and analysis : This question examines the connection operation of string and basic data type . The content enclosed in double quotation marks is a string , The contents of the string are output directly , Join integer variables with plus sign , Integer variable x It's a direct output x Of the value of
. So the output is x=56,B The option is correct .

* The following is true double The wrong representation of the type literal is ?
A. 1.23
B. 1.23d
C. 1.23D
D. 1.23f

Answer and analysis : An examination of this question double Representation of type literal value . stay Java in , Like 1.23 The default literal value of is double Type , You can also add it after the data d perhaps D, therefore A,B,C Three options are correct .1.23f yes float Representation of type literals , therefore D Wrong option .

* Which of the following statements is wrong ?
A. double d=12.3d;
B. double d=12.3D;
C. float f=1.23f;
D. float f=1.23;

Answer and analysis : This question is about the literal representation of floating point type , And how to assign values to floating-point variables .A Options will double The literal value of the type 12.3d Assign to double Variable of type d, no problem .B Options and A The options are similar , It's just that the literal value is 12.3D, The last letter is uppercase D.double The type literal value is used in the representation , The end can be d or D.C Options will float The literal value of the type 1.23f Assign to float Variable of type , No problem .D option float
f=1.23;1.23 There is no letter after it , The default is double The literal value of the type , take double The data of type is assigned to float Type will have compilation errors . Choose the wrong sentence , So choose D.

* The result of running the following code is public class CharTest{ public static void main(String[] args){
char c='A'; System.out.println(c); char c1=65; System.out.println(c1); } }
A. A
B. 65
C. A
65
D. A
A

Answer and analysis : This question examines the conversion between character type and integer type ,D The option is correct . character ‘A’ Output is still A, And integers 65 It's a capital letter ’A’ Of ASCII Code value , because c1 yes char Variable of type , Therefore, it will be converted into character type output . So output two lines , Output one per line A.

<> One , Multiple choice

* Which of the following identifiers are legal ?
A. $value
B. Void
C. class
D. 1abc
E. my value
F. void_class

Answer and analysis : This question is to examine the naming rules of identifiers , The identifier can be composed of letters , number , It consists of an underline and a dollar sign , Cannot start with a number ; Case sensitive , Cannot be a keyword .A The option is correct ,B The option is correct ,void It's a keyword , But identifiers are case sensitive , therefore Void and void Not the same identifier .
C Wrong option ,class It's a keyword , Cannot be used as identifier . D Wrong option , Identifier cannot start with a number .E Wrong option , The identifier cannot contain spaces .
F The option is correct ,void and class It's all keywords , But it's underlined in the middle , There is no problem forming a new identifier .

* The following data types that can represent numeric data are ?
A. byte
B. float
C. boolean
D. long

Answer and analysis : The basic data types are examined ,byte,long Represents numeric data of integer type ,float Represents numeric data of floating point type ,boolean Represents Boolean data , It is not numerical data .

* The following statements about assignment operators are correct ?
A. use “=” Assign values to variables
B. use “==” Assign values to variables
C. "=" It's called the assignment operator , Assign the value on the right of the operator to the variable on the left
D. "=" It's called the assignment operator , Assign the value on the left of the operator to the variable on the right
Answer and analysis : This question examines the concept of assignment operator , stay Java in “=” Is the assignment operator , Is to assign the value on the right of the operator to the variable on the left ."==” Is a relational operator . therefore AC The option is correct .

Technology
©2019-2020 Toolsou All rights reserved,
The project followed for a year , The customer finally said no Python read Excel A column | Transfer deposit json( Essence )2020 year 6 month 26 day C# Class library Loop execution help class Vue + Element-ui Drop down box for el-select Get extra parameters ( Essence )2020 year 8 month 15 day redis database StackExchange.Redis in Set type (C# edition )( Essence )2020 year 7 month 30 day Wechat applet Use of modules Keras Summary of training data loading python Dynamic programming for single source shortest path JQ get request Splicing url parameter ( query criteria )( Essence 2020 year 6 month 2 Daily update ) TypeScript Function explanation