计算机类
公务员类
工程类
语言类
金融会计类
计算机类
医学类
研究生类
专业技术资格
职业技能资格
学历类
党建思政类
行业认证
全国计算机应用水平考试(NIT)
计算机软件水平考试
计算机等级考试(NCRE)
全国高校计算机等级考试CCT
行业认证
信息素养
问答题public class Sum  public static void main( String args[ ]) double sum = 0.0 ; for ( int i = 1 ; i <= 100 ; i + + ) sum += 1.0/(double) i ; System.out.println( "sum="+sum );
进入题库练习
问答题编写一个Frame框架应用程序,要求如下: (1) 在窗口设置两个菜单“文件”、“编辑” (2) 在“文件”菜单里添加三个菜单项“打开”、“保存”、“关闭” (3) 在“编辑”菜单里添加两个菜单项“复制”、“粘贴” (4) 点击关闭菜单项时,使程序关闭。
进入题库练习
问答题什么是继承?
进入题库练习
问答题按以下要求编写程序 (1) 编写Animal接口,接口中声明run______ 方法 (2) 定义Bird类和Fish类实现Animal接口 (3) 编写Bird类和Fish类的测试程序,并调用其中的run______方法
进入题库练习
问答题import java.io.* ; public class abc public static void main(String args[ ]) ) System.out.println("a="+a+"/nb="+b); class SubClass extends SuperClass int c; SubClass(int aa,int bb,int cc) super(aa,bb); c=cc; class SubSubClass extends SubClass int a; SubSubClass(int aa,int bb,int cc) super(aa,bb,cc); a=aa+bb+cc; void show() System.out.println("a="+a+"/nb="+b+"/nc="+c);
进入题库练习
问答题import java.io.*; public class abc public static void main(String args[ ]) AB s = new AB("Hello!","I love JAVA."); System.out.println(s.toString( )); class AB String s1; String s2; AB( String str1 , String str2 ) s1 = str1; s2 = str2; public String toString( ) return s1+s2;
进入题库练习
问答题阅读下面的程序,并回答问题(①问3分,②问3分,共6分)。 import java.io.*; public class Test public static void main(String args[]) throws IOException BufferedReader buf=new BufferedReader( new InputStreamReader(System.in)); while(true) String str = buf.readLine(); if(str.equals("quit")) break; int x=Integer.parseInt(str); System.out.println(x*x); 编译运行上面的程序: ①从键盘输入10,回车后输出的结果如何? ②从键盘输入exit,回车后程序能正确执行吗?为什么?
进入题库练习
问答题阅读下面的程序,回答问题。 import java.awt.*; import javax.swing.*; public class T extends JFrame public T ______ super("GridLayout"); Container con=this.getContentPane______; con.setLayout(new GridLayout(2,3)); con.add(new JButton("a")); con.add(new JButton("b")); con.add(new JButton("c")); con.add(new JButton("d")); con.add(new JButton("e")); con.add(new JButton("f")); setSize(200, 80); setVisible(true); public static void main(String args[]) new T______; ①画图表示程序运行后的图形界面。 ②如果程序通过实现某个接口处理按钮的动作事件,则该接口名为何?接口中的方法头声明如何?
进入题库练习
问答题写出下面的程序编译、运行后的结果(6分)。 public class Test public static void main(String args[]) new Student("Tom", 'm', 90, 88); new Student("Jack", 'm', 66, 89); new Student("Mary", 'f', 76, 86); System.out.println("name/tsex/tchinese/tenglish"); Student.print(); class Student protected String name; protected char sex; protected int chinese; protected int english; protected Student next; static Student list; Student(String name, char sex, int chinese, int english) this.name=name; this.sex=sex; this.chinese=chinese; this.english=english; this.next=list; list=this; static void print() Student friend=list; if(friend==null) System.out.println("The list is empty."); else do System.out.println(friend.toString()); friend=friend.next; while(friend!=null); public String toString() return new String(name+"/t"+sex+"/t"+chinese+"/t"+english);
进入题库练习
问答题编写一个字符界面的Java Application 程序,接受用户输入的10个整数,并输出这10个整数的最大值和最小值。
进入题库练习
问答题阅读下面的程序,并回答问题(①问3分,②问3分,共6分)。 import java.io.*; public class Test public static void main(String args[]) throws IOException BufferedReader buf=new BufferedReader( new InputStreamReader(System.in)); while(true) String str=buf.readLine______; if(str.equals("quit")) break; int x=Integer.parseInt(str); System.out.println(x*x); 编译运行上面的程序: ①从键盘输入5,回车后输出的结果如何? ②从键盘输入quit,回车后程序执行情况如何?
进入题库练习
问答题按以下要求编写程序 (1) 创建一个Rectangle类,添加width和height两个成员变量 (2) 在Rectangle中添加两种方法分别计算矩形的周长和面积 (3) 编程利用Rectangle输出一个矩形的周长和面积
进入题库练习
多选题Objects are passed by ______. A. Value B. Sum C. Reference D. Pointer
进入题库练习
多选题Given: public class ArithmeticResultsOutput { public static void main(String[] args { inti1=100; intj1= 200; if((i1==99) } else { System.out.print("Value2: "+(i1+j1+" "); } inti2=100; intj2=200; if((i2==99) } else { System.out.print("Value2: "+(i2+j2+" "); } inti3=100; intj3=200; if((i3==100) | (--j3==200)) { System.out.print("Value1: "+(i3+j3+" "); } else { System.out.print("Value2: "+(i3+j3+" "); } inti4=100; intj4=200; if((i4==100) || (--j4==200)) { System.out.print("Value1: "+(i4+j4+" "); } else { System.out.print("Value2: "+(i4+j4+" "); } } } What will be printed to standard out? A. Value2: 300 Value2: 300 Value1: 300 Value1: 300 B. Value2: 299 Value2: 300 Value1: 299 Value1: 300 C. Value1: 299 Value1: 300 Value2: 299 Value2: 300 D. Value1: 300 Value1: 299 Value2: 300 Value2: 299
进入题库练习
多选题下面说法正确的是______。 A.如果某公共接口被声明在一个源文件中,则接口必须与源文件具有相同名字。 B.如果源文件包含import语句,则该语句必须是除空行和注释行外的第一个语句行。 C.如果某源文件包含package语句,则该语句必须是第一个非空、非注释行。 D.接口中的方法必定是抽象方法,但可以不用关键字abstract修饰。
进入题库练习
多选题Given the SampleClass, when the following code segment is executed, what is the value of the instance variable size? SampleClass sampleClass = new SampleClass(5); public class SampleClass { private int size; public SampleClass(int size) { size = size; } } A. 0 B. 1 C. 5 D. Compiler error E. Runtime error
进入题库练习
多选题What is the difference between an int and an Integer? A. Nothing. They are both fully interchangeable. B. An int is an object and Integer is a primitive. An int is fastest when performing calculations. C. An int is a primitive and Integer is an object. An int is fastest when performing calculations. D. This is a trick question. There is no such thing as an Integer. E. This is a trick question. An Integer can be defined to be anything a developer wants it to be.
进入题库练习
多选题What array type has the most overhead? A. One-dimensional array B. Multi-dimensional array C. ArrayList
进入题库练习
多选题下面main______方法的定义哪些是正确的______? A.public static void main(String args[]) B.public static void main(String[]) C.public static void main(String[] args) D.public static void main(String [] x)
进入题库练习
多选题Primitives are passed by ______. A. Value B. Sum C. Reference D. Pointer
进入题库练习