题目内容

下面有关转义字符使用不符合语法定义的有 ( ).

A. char ch = '\\';
B. char ch = '\''
C. char ch = '\128'
D. char ch = '\u1234';
E. char ch = "'"

查看答案
更多问题

下面哪些语句编译错误?()

A. short s1 = 'b';
B. char c1 = 98;
C. short s2 = c1;
D. char c2 = s1;
E. short s3 = (short)c1;
F. char c3 = (char)s1;

以下描述正确的是()。

A. 语句char c = -1;编译正确
B. 语句System.out.println((byte)128);编译和执行都正确
C. 语句byte ic = 'A'; 编译正确
D. 语句byte ic1 = 'B' + 12; 编译正确
E. 语句byte ic2 = 'B' + 100; 编译错误

以下程序段错误的有( )

A. byte a=1,b=1;byte c=a+b;
B. byte a=1,b=1;byte c=(byte)(a+b);
C. byte a=1,b=1;int c=a+b;
D. byte a=1,b=1;byte c=(byte)a+(byte)b;

int a = 4;a = a++;问最后a=( )。

答案查题题库