考试网 >> IT认证 >> JAVA >> JAVA题库 >> JAVA题库:格林模拟试题一(上)

JAVA题库:格林模拟试题一(上)

发布时间:2006-06-28 10:50     点击:
分页:上一页  1 2 3 4 5 6 7 [8] 

2) 19 followed by 11

3) Compile time error

4) 10 followed by 1

Question 26)

If you run the code below, what gets printed out?

String s=new String("Bicycle");

int iBegin=1;

char iEnd=3;

System.out.println(s.substring(iBegin,iEnd));

1) Bic

2) ic

3) icy

4) error: no method matching substring(int,char)

Question 27)

If you wanted to find out where the position of the letter v (ie return 2) in the string s containing "Java",which of the following could you use?

1) mid(2,s);

2) charAt(2);

3) s.indexOf('v');

4) indexOf(s,'v');

Question 28)

Given the following declarations

String s1=new String("Hello")

String s2=new String("there");

String s3=new String();

Which of the following are legal operations?

1) s3=s1 + s2;

2) s3=s1-s2;

3) s3=s1 & s2;

4) s3=s1 && s2

Question 29)

What is the result of the following operation?

System.out.println(4 | 3);

1) 6

2) 0

3) 1

4) 7

Question 30)

public class MyClass1 {

public static void main(String argv[]){ }

/*Modifier at XX */ class MyInner {}

}

What modifiers would be legal at XX in the above code?

1) public

2) private

3) static

4) friend

分页:上一页  1 2 3 4 5 6 7 [8] 
版权申明:未经书面授权请勿转载本站信息!!作品版权归所属媒体与作者所有!!
发表评论: 匿名发表 用户名: 查看评论
您将承担一切因您的行为、言论而直接或间接导致的民事或刑事法律责任
留言板管理人员有权保留或删除其管辖留言中的任意内容
本站提醒:不要进行人身攻击。谢谢配合。
在本站搜索相关信息
2003-2005 Ksw123.com All Rights Reserved. - TOP
Copyright © 2006 Ksw123.com. All rights reserved.中国考题网 版权所有