单选题现有: package mypack; import java.awt.Color; import java.awt.FlowLayout; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; public class ButtList extends JFrame { public static void main(String[] args) { ButtList bl =new ButtList(); } ButtList(){ JPanel pl=new JPanel(); pl.setBackground (Color.pink); p1.add(new JButton("one")); p1.add(new JButton("Two")); p1.add(new JButton("Three")); add("South",p1); setLayout(new Fl.wLayout()); setSize(200,200); setVisible(true); } } 上述代码运行后的显示效果是哪项?()A3个按钮从左到右排列在Frame的底部B3个按钮从左到右排列在Frame的顶部C按钮无法显示D只有按钮Three显示出来并占据Frame整个区域
单选题
现有: package mypack; import java.awt.Color; import java.awt.FlowLayout; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; public class ButtList extends JFrame { public static void main(String[] args) { ButtList bl =new ButtList(); } ButtList(){ JPanel pl=new JPanel(); pl.setBackground (Color.pink); p1.add(new JButton("one")); p1.add(new JButton("Two")); p1.add(new JButton("Three")); add("South",p1); setLayout(new Fl.wLayout()); setSize(200,200); setVisible(true); } } 上述代码运行后的显示效果是哪项?()
A
3个按钮从左到右排列在Frame的底部
B
3个按钮从左到右排列在Frame的顶部
C
按钮无法显示
D
只有按钮Three显示出来并占据Frame整个区域
参考解析
解析:
暂无解析
相关考题:
下列Java源程序结构中前三种语句的次序,正确的是A.import, package, public classB.import必为首,其他不限C.public class, import, packageD.package, import, public class
下列哪个选项的java源文件代码片段是不正确的?A.package testpackage; public class Test{ }B.import java. io. *; package testpaekage; public class Test { }C.import java.io.*; class Person { } public class Test { }D.import java.io.*; import java. awt.*; public class Test{ }
下列( )选项的java源文件代码片段是不正确的。A.package testpackage; publicClass Test{}B.import java.io.*; package testpackage: publicClass Test{}C.import java.io.*; Class Person{} publicClass Test{}D.import java.io.*; import java.awt.*; publicClass Test{}
下列哪个选项的java源文件程序段是不正确的? ( )A.package testpackage; public class Test{ }B.import java.io.*; package testpackage; public class Test{ }C.import java.i.*; class Person{} public class Test{ }D.import java.io.*; import java.awt.*; public class Test { }
现有如F包结构: com |一一X | |一一Alpha.class | | | |一一y I |一一Beta.class | |l-- Gamma.class 和类: class Test { Alpha a; Beta b; Gamma c; } 哪三个必须加入到类Test中,以使其通过编译?() A、 package y;B、 package com;C、 import com.x.y.*;D、 import com.x.*;
一个程序中,package、import、和class的排放次序是()A、package、import、classB、import、package、classC、三者任意D、class在最后,import、package排放次序任意
现有包结构: com |-- x | |-- Alpha.class | | | |-- y | |-- Beta.class | |-- Gamma.class 和类: //insert code here import com.*; import com.x.y.*; class Test { Alpha a; Beta b; Gamma c; } 哪两行分别插入后可允许代码编译?() A、package com.;B、import com.x;C、package com.x;D、import com.x.Alpha;
现有如下包结构: com |-- x | |-- Alpha.class | | | |-- y | |-- Beta.class | |-- Gamma.class 和类: class Test { Alpha a; Beta b; Gamma c; } 哪三个必须加入到类 Test 中,以使其通过编译?()A、package y;B、package com;C、import com.x.*;D、import com.x.y.*
在单一文件中import、class和package的正确出现顺序是()A、package,import,classB、class,import,packageC、import,package,classD、package,class,import
在Java语言中,在包Package1中包含包Package2,类Class_A直接隶属于包Package1,类Class_B直接隶属于包Package2,在类Class_C要应用Class_A的方法A和Class_B的方法B,你需要()语句。A、import Package1.*;B、import Package1.Package2.*;C、import Package2.*;D、import Package2.Package1.*;
与page指令%@ page import= “java.util.*, java.text.* “ % 等价的是()。A、%@ import="“java.util.*" page=""%@ import="“java.text.*" page=""%@ import="“java.text.*" page=""%@ import="“java.util.*" page=""%@ import="“java.text.*" page=""%@ import="“java.util.*" page=""%@ page import= “java.util.* % %@ page import= “java.text.* “ % B、%@ page import= “java.util.*” , import= “java.text.* “ % C、%@ page import= “java.util.* “ ; % %@ page import= “java.text.* “ ; %D、%@ page import= “java.util.* ; java.text.* “ %
定义Java.Applet程序时,必须有的import语句是()。A、import java.awt.event;B、import java.util. * ;C、import java.applet.Applet;D、import java.1ang.* ;
下列有关类声明的代码片段,哪一项是正确的?() A、 import java.sql.*; package school; class Student{ }B、 package school; import java.sql.*; class Student{ }C、 package school; class Student{ } import java.sql.*;D、 package school; import java.sql.*;private String name; class Student{ }
package sun.scjp; public enum Color { RED, GREEN, BLUE } package sun.beta; // insert code here public class Beta { Color g = GREEN; public static void main( String[] argv) { System.out.println( GREEN); } } The class Beta and the enum Color are in different packages. Which two code fragments, inserted individually at line 2 of the Beta declaration, will allow this code to compile?()A、 import sun.scjp.Color.*;B、 import static sun.scjp.Color.*;C、 import sun.scjp.Color; import static sun.scjp.Color.*;D、 import sun.scjp.*; import static sun.scjp.Color.*;E、 import sun.scjp.Color; import static sun.scjp.Color.GREEN;
Given a class Repetition: 1.package utils; 2. 3.public class Repetition{ 4.public static String twice(Strings){returns+s;} 5.} and given another class Demo: 1.//insert code here2. 3.public class Demo{ 4.public static void main(String[]args){ 5.System.out.println(twice("pizza")); 6.} 7.} Which code should be inserted at line 1 of Demo.java to compile and run Demo to print“pizzapizza”?()A、import utils.*;B、static import utils.*;C、importutils.Repetition.*;D、static importutils.Repetition.*;E、import utils.Repetition.twice();F、import static utils.Repetition.twice;G、static import utils.Repetition.twice;
在类Acoount中,正确引入类school.Student的语句是哪一项?() A、import schoolB、import schllo.*C、package school.StudentD、import Student
定义类: package utils; public class Rep{ public static String twice (String s){return s+s ;} } 再定义另一个类Demo: //insert code here public class Demo{ public static void main (String[] args){ System. out .println( twice( "Hello")); } } 在第一行插入哪项代码,可以使程序正常编译和执行?() A、import utils.*;B、 import utils.Rep.*;C、 import static utils.Rep.twice;D、 static import utils.Rep.twice;
单选题在单一文件中import、class和package的正确出现顺序是()Apackage,import,classBclass,import,packageCimport,package,classDpackage,class,import
单选题下列有关类声明的代码片段,哪一项是正确的?()A import java.sql.*; package school; class Student{ }B package school; import java.sql.*; class Student{ }C package school; class Student{ } import java.sql.*;D package school; import java.sql.*;private String name; class Student{ }
单选题现有: package mypack; import javax.swing.JButton; import javax.swing.JFrame; public class Butt extends JFrame { public static v.id main(string[] args) { // TODO Auto-generated method stub Butt butt=new Butt(); } Butt(){ JButton jbl=new JButton("Hello"); JButton jb2=new JButton("World"); add(jbl); add(jb2); setSize(300,300); setVisible(true); } } 下列关于代码运行效果的叙述正确的是哪项? ()A2个按钮紧靠着排列,Hello在World的左侧B Hello占据Frame的整个区域C World占据Frame的整个区域D2个按钮都在Frame的顶部
单选题一个程序中,package、import、和class的排放次序是()Apackage、import、classBimport、package、classC三者任意Dclass在最后,import、package排放次序任意
单选题下列Java源程序结构中前三种语句的次序,正确的是( )。Aimport,package,public classBimport必为首,其他不限Cpublic class,package,importDpackage,import,public class
单选题与page指令 等价的是()。A%@ import="“java.util.*" page=""%@ import="“java.text.*" page=""%@ import="“java.text.*" page=""%@ import="“java.util.*" page=""%@ import="“java.text.*" page=""%@ import="“java.util.*" page=""%@ page import= “java.util.* % %@ page import= “java.text.* “ % B%@ page import= “java.util.*” , import= “java.text.* “ % C%@ page import= “java.util.* “ ; % %@ page import= “java.text.* “ ; %D%@ page import= “java.util.* ; java.text.* “ %
单选题Given a class Repetition: 1. package utils; 2. 3. public class Repetition { 4. public static String twice(String s) { return s + s; } 5. } and given another class Demo: 1. // insert code here 2. 3. public class Demo { 4. public static void main(String[] args) { 5. System.out.println(twice(”pizza”)); 6. } 7. } Which code should be inserted at line 1 of Demo.java to compile and run Demo to print“pizzapizza”?()A import utils.*;B static import utils.*;C import utils.Repetition.*;D static import utils.Repetition. *;E import utils.Repetition.twice();F import static utils.Repetition.twice;G static import utils.Repetition.twice;