以下哪个类能正确编译?()
A. class a{ abstract void disp(); }
B. abstract class a{ void disp(){ System.out.println("welcome to Beijing!"); } }
C. class a{ abstract void disp(){ System.out.println("welcome to Beijing!"); } }
D. abstract class a{ final abstract void disp();}
A:class中的constructor不可省略B:constructor必须与class同名,但方法不能与class同名C:constructor在一个对象被new时执行D:一个class只能定义一个constructor下面哪个类用来从一个文本文件中读取数据信息?(C).
A. File
B. Scanner
C. PrintWriter
D. System
下列程序的输出结果为?(B)import javax.swing.*; public class Test { public static void main(String[] args) { JButton jbtOK = new JButton("OK"); System.out.print(jbtOK.isVisible() + ", "); JFrame frame = new JFrame(); System.out.println(frame.isVisible()); }}
A. true, false
B. true, true
C. false, true
D. false, false
已知如下类说明public class Test {private float f = 1.0;int m = 12;static int n=1;public static void main(String arg[]) {Test t = new Test();____________________________.} }在空格处如下哪个使用是错误的?().
A. this.m
B. t.f
C. t.m
D. n