新建一个流对象,下列( )选项的代码是错误的。
A: new BufferedWriter(new FileWriter("a.txt"));
B: new BufferedReader(new FileInputStream("a.dat"));
C: new DataOutputStream(new FileOutputStream("a.txt"));
D: new ObjectInputStream(new FileInputStream("a.dat"));
A: new BufferedWriter(new FileWriter("a.txt"));
B: new BufferedReader(new FileInputStream("a.dat"));
C: new DataOutputStream(new FileOutputStream("a.txt"));
D: new ObjectInputStream(new FileInputStream("a.dat"));
举一反三
- 新建一个流对象,下列( )选项的代码是错误的。 A: new BufferedWriter(new FileWriter("a.txt")); B: new BufferedReader(new FileInputStream("a.dat")); C: new DataOutputStream(new FileOutputStream("a.txt")); D: new ObjectInputStream(new FileInputStream("a.dat"));
- 下列哪个选项是创建一个标识有“关闭”按钮的语句? ( ) A: JTextField b = new JTextField("关闭"); B: JTextArea b = new JTextArea ("关闭"); C: JButton b = new JButton("关闭"); D: JCheckbox b = new JCheckbox("关闭");
- 创建一个标识有“关闭”按钮的语句是( )。 A: JTextField button = new JTextField("关闭"); B: JButton button = new JButton("关闭"); C: JLabel button = new JLabel ("关闭"); D: JCheckbox button = new JCheckbox("关闭");
- 下列方法中,能正确创建 JavaScript 对象的是( )。 A: var txt = new Object[name:"George",price:25] B: var txt = new Object(name:"George",price:25) C: var txt = new Object{name:"George",price:25} D: var txt = new Object({name:"George",price:25})
- 定义并初始化一个用于存放我们国家的四个直辖市的数组cityName,四个直辖市为:北京,上海,天津,重庆. 正确的是_________ A: String[] cityName=new String[4]{"北京","上海","天津","重庆"}; B: String[] cityName=new String[]{"北京","上海","天津","重庆"}; C: String[] cityName={"北京","上海","天津","重庆"}; D: String cityName = new String[4] { "北京", "上海", "天津", "重庆" };