东华理工大学2012 —2013 学年第 1 学期考试试卷
JA V A程序设计课程闭卷课程类别:考查B
1 选择题(共35分)
1.What is suffix(后缀) of Java class file?()?
A、.java
B、.class
C、.txt
D、.ext
2. Which command can run Java class file? ( )?
A、edit
B、dir
C、java
D、javac
3. Which identifies is illegal ( )?
A、$_123
B、中国
C、you_can_al D some++name
4. Which conversion (转换) is legal ( )?
A、int x=1000.1;
B、int x=’a’;
C、short x=10000;
D、int x=12L; 5.class example {
public static void main(String args[]) {
boolean b;
b = (4 > 3) && (3 < 2);
System.out.print("b = "+b);
b = false || true ;
System.out.println("b = "+b); } }
What is the result?()
A、b=false b=true
B、b=true b= false
C、b=true b= true
D、b= false b= false
6. class example {
public static void main(String args[]) {
int [] a= {1,2,3,4,5};
int i=3;
a[i--]=a[i--]+2;
System.out.println(a[i++]);
}} What is the result?()
A, 4 B, 5 C 3, D,2
7.class gggg{String tr=new String("hello");
char[]th={'a','b','n'};
public void change(String str,char ch[]){
str="tcwt ok";
ch[0]='z';}
public static void main(String args[]){
gggg ex=new gggg();