初心社区
2023年新星计划导师
2023-06-01 21:55:10
paint()方法使用哪种类型的参数? ( ) A、Graphics B、Graphics2D C、String D、Color
...全文
166 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
初心社区 2023-06-01
  • 打赏
  • 举报
回复 1
paint方法参数
Java面向对象程序设计试题一 一、单项选择题 D1、欲构造ArrayList类的一个实例,此类继承了List接口,下列哪个方法是正确的?( ) A ArrayList myList=new Object(); B List myList=new ArrayList(); C ArrayList myList=new List(); D List myList=new List(); C2、paint ( )方法使用种类参数? A Graphics B Graphics2D C String D Color D3、指出正确的表达式 ( ) A byte=128; B Boolean=null; C long l=0xfffL; D double=0.9239d; 4、指出下列程序运行的结果 ( )。 public class Example{   String str=new String("good");   char[]ch={'a','b','c'};   public static void main(String args[]){     Example ex=new Example();     ex.change(ex.str,ex.ch);     System.out.print(ex.str+" and ");     Sytem.out.print(ex.ch);   }   public void change(String str,char ch[]){     str="test ok";     ch[0]='g';   } } A good and abc B good and gbc C test ok and abc D test ok and gbc A5、运行下列程序, 会产生什么结果 ( ) public class X extends Thread implements Runable{  public void run(){   System.out.println("this is run()");  }  public static void main(String args[])  {   Thread t=new Thread(new X());   t.start();  } } A 第一行会产生编译错误 B 第六行会产生编译错误 C 第六行会产生运行错误 D 程序会运行和启动 A6、要从文件" file.dat"文件中读出第10个字节到变量C中,下列哪个方法适合? ( ) A FileInputStream in=new FileInputStream("file.dat"); in.skip(9); int c=in.read(); B FileInputStream in=new FileInputStream("file.dat"); in.skip(10); int c=in.read(); C FileInputStream in=new FileInputStream("file.dat"); int c=in.read(); D RandomAccessFile in=new RandomAccessFile("file.dat"); in.skip(9); int c=in.readByte(); 7、容器被重新设置大小后,哪种布局管理器的容器中的组件大小不随容器大小的变化而 改变? ( ) A CardLayout B FlowLayout C BorderLayout D GridLayout C8、给出下面代码: public class Person{   static int arr[] = new int[10];   public static void main(String a[])   {    System.out.println(arr[1]);   } } 那个语句是正确的? ( ) A 编译时将产生错误; B 编译时正确,运行时将产生错误; C 输出零; D 输出空。 9、哪个关键字可以对对象加互斥锁 ?( ) A transient B synchronized C serialize D static 10、下列哪些语句关于内存回收的说明是正确的? ( ) A 程序员必须创建一个线程来释放内存; B 内存回收程序负责释放无用内存 C 内存回收程序允许程序员直接释放内存 D 内存回收程序可以在指定的时间释放内存对象 二、多项选择题 AB1、下面哪些标识符在Java语言中是合法的?( ) A persons$ B TwoUsers C *point D instanceof F.end-line BD2、下面哪些代码片段

592

社区成员

发帖
与我相关
我的任务
社区描述
哈喽,大家好啊!欢迎来到向阳花花花花社区,这将是一段新的旅程的开始。
javapythonc++ 个人社区 江西省·萍乡市
社区管理员
  • 向阳花花花花
  • 码银
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

汇集Java的爱好者和关注者,是一个有交流有爱的大家庭。大家共同学习、探索、分享Java基础知识和前沿技术,正如我们的社区名字一样,希望大家在通往技术大牛的路上越走越远,但也不要忘记了我们的初心,那个带领我们走进编程的‘hello world’,以及,那个我们最爱的人。

试试用AI创作助手写篇文章吧