题库 题库

【单选题】

请阅读下面程序
import java.io.*;
public class TypeTransition{
public static void main(String args[]){
char a = 'a';
int i = 100;
long y = 456L;
int aa = a + i;
long yy = y-aa;
System.out.print("aa = "+aa);
System.out.print("yy = "+yy);
}
}
程序运行结果是
  • A.aa = 197  yy = 259

  • B.aa = 177  yy = 259

  • C.aa = 543  yy = 288\TAB

  • D.aa = 197  yy = 333\TAB \TAB

参考答案

查看答案

相关试题

单选题 在下列关系运算中,不改变关系表中的属性个数但能减少元组个数的是 查看答案
单选题 请阅读下面程序
import java.io.*;
public class ExceptionCatch{
public static void main(String args[]){
try{
FileInputStream fis=new FileInputStream("text");
System.out.println("content of text is:");
}
catch(FileNotFoundException e){
System.out.println(e);
System.out.println("message:"+e.getMessage());
e.printStackTrace(System.out);
}____________________{
System.out.println(e);
}
}
}
为保证程序正确运行,程序中下划线处的语句应是
查看答案
单选题 在下列Java语言的包中,提供图形界面构件的包是 查看答案
单选题 请阅读下面程序
public class ForLoopStatement {
public static void main(String[] args) {
int i,j;
for(i=1;i<5;i++){  \TAB     //i循环
for(j=1;j<=i;j++)  \TAB //j循环
System.out.print(i+"×"+j+"="+i*j+"  ");
System.out.println();
}
}
}
程序完成后,i循环和j循环执行的次数分别是
查看答案
单选题 下列叙述中,错误的是 查看答案
单选题 请阅读下面程序
import java.io.*;
public class TypeTransition{
public static void main(String args[]){
char a = 'a';
int i = 100;
long y = 456L;
int aa = a + i;
long yy = y-aa;
System.out.print("aa = "+aa);
System.out.print("yy = "+yy);
}
}
程序运行结果是
查看答案
单选题 下列叙述中错误的是 查看答案
单选题 Panel类的默认布局管理器是 查看答案
单选题 下列叙述中,错误的是 查看答案
单选题 请阅读下面程序
public class ThreadTest {
public static void main(String args[ ]) throws Exception{
int i=0;
Hello t = new Hello( );
__________________;
while( true){
System.out.println("Good Morning"+i++);
if (i == 2 && t.isAlive()){
System.out.println("Main waiting for Hello!");
t.join();  //等待t运行结束
}
if (i==5)  break ;}
}
}
class Hello extends Thread{
int i ;
public void run( ){
while( true){
System.out.println("Hello"+i++);
if (i==5)  break ;}}}
为使该程序正确执行,下划线处的语句应是
查看答案
单选题 Java语言与C++语言相比,最突出的特点是 查看答案
单选题 下列叙述中正确的是 查看答案
单选题 下列叙述中,错误的是 查看答案
单选题 下列叙述中正确的是 查看答案
单选题 下列叙述中,错误的是 查看答案
单选题 下列叙述中,错误的是 查看答案
单选题 下列叙述中,正确的是 查看答案
单选题 对下列二叉树
  
进行前序遍历的结果是
查看答案
单选题 请阅读下面程序
public class ExampleStringBuffer{
public static void main(String[] args){
StringBuffer sb=new StringBuffer ("test");
System.out.println("buffer ="+sb);
System.out.println("length ="+sb.length());
}
}
程序运行结果中在"length="后输出的值是
查看答案
单选题 下列叙述中,错误的是 查看答案