题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-28 02:36:23

[单项选择] 在Java语言中,包pack1的类class1中有成员方法:  protected void  method_1(){„},  private void method_2() {„},  public void method_3() {„}  和  void method_4() {„},  在包pack2中的类class2不是class1的子类,你在class2中可以调用方法()。 
A. method_1
B. method_2
C. method_3
D. method_4

更多"在Java语言中,包pack1的类class1中有成员方法:&ensp"的相关试题:

[多项选择] 包pack1的类class1中有成员方法: protected void method_1(){„}, private void method_2() {„},  public void method_3() {„}  和  void method_4() {„},  在包pack2中的类class2是class1的子类,你在class2中可以调用方法()。 
A. method_1
B. method_2
C. method_3
D. method_4
[单项选择]在Java语言中,包pack1的类class1中有成员方法:protectedvoidmethod_1(){…},privatevoidmethod_2(){…},publicvoidmethod_3(){…}和voidmethod_4(){…},在包pack2中的类class2不是class1的子类,你在class2中可以调用方法()。
A. method_1
B. method_2
C. method_3
D. method_4
[多项选择]包pack1的类class1中有成员方法:protectedvoidmethod_1(){…},privatevoidmethod_2(){…},publicvoidmethod_3(){…}和voidmethod_4(){…},在包pack2中的类class2是class1的子类,你在class2中可以调用方法()。
A. method_1
B. method_2
C. method_3
D. method_4
[单项选择] 在Java语言中,下面是main()方法的部分代码:    Frame f = new Frame("My Frame");   f.setSize(100,100);    为在屏幕显示f,应增加的代码是()。 
A. f.appear();
B. f.setForeground();
C. f.setVisible();
D. f.enable();
[单项选择] 在Java语言中,如果你有下面的类定义:   abstract class Shape {  abstract void draw();    }    Class Square extends Shape {}  如果你试图编译上面的代码会发生()。 
A. 一切成功编译
B. Shape可以编译,Square不能编译
C. Square可以编译,Shape不能编译
D. Shape,Square都不能编译
[单项选择] 在Java语言中,一个Applet具有如下init()方法: public void init(){  setLayout(new  BorderLayout());  add(BorderLayout.EAST,  new Button(“Click ME!”));} 当该Applet载入时,用户外观将是()。
A. 没有任何内容
B. 居中位置有个按钮
C. 左边有个按钮
D. 右边有个按钮
E. 一个按钮填充整个用户界面上
[单项选择] In a Java EE messaging application, one MDB is consuming a lot of memory at high traffic.    What configuration should you use to prevent possible out-of-memory error at high traffic and at the same time not losing messages?()
A. Configure a Work Manager for the MDB with a Maximum Thread Constraint.
B. Configure a Work Manager for the MDB with a Minimum Thread Constraint.  
C. Configure a Work Manager for the MDB with a Maximum Thread Constraint and a Capacity  Constraint. 
D. Configure a Work Manager for the MDB with a Minimum Thread Constraint and a Capacity Constraint. 
E. Configure a Work Manager for the MDB with both a Maximum Thread Constraint and Minimum Thread Constraint.
[多项选择] You deployed a Java EE Shared Library and want to use it from an application that is also deployed on the same cluster.    Which two manifest attributes must be specified at a minimum with corresponding values in the deployment descriptor of the application that requires?()
A. Implementation-Version
B. Specification-Version
C. Extension-Name  
D. Specification-Vendor
E. Implementation-Vendor
[单项选择] 现有:      -f是一个对java .io.File实例的合法引用      - fw足‘个对java.io.FileWriter实例的合法引用      - bw足一个对java.io.BufferedWriter实例的合法引用      以下哪一项无效?() 
A. PrintWriter prtWtr = new PrintWriter (f);
B. PrintWriter prtWtr  = new  PrintWriter( fw);
C. PrintWriter prtWtr = new PrintWriter(bw):
D. BufferWriter bufWtr = new BufferedWritr(f);
E. BufferWriter  bufWtr  =  new  BufferedWriter(fw);
F. BufferWriter bufWtr = new BufferedWriter (bw):
[单项选择] class java {  public static void main(String [] java) {   for (int Java = 1; Java 〈 java.length; Java++)   System.out.print("java ");   }   }   和命令行:  java java java java java   结果为:()  
A. java
B. java java
C. java java java
D. 编译失败
[单项选择] 在Java语言中,如果你有下面的类定义:  Abstract class Shape{ Abstract void draw(); }  class Square extendeds Shape{} 如果你试图编译上面的代码会发生()。 
A. 一切成功编译
B. Shape可以编译,Square不能编译
C. Square可以编译,Shape不能编译
D. Shape,Square都不能编译
[单项选择] 在J2EE中,某一java程序中有如下代码:  DataInputStream din = new DataInputStream(new BufferedInputStream                            (new FileInputStream("employee.dat")));  System.out.print(din.readByte());  假设在employee.dat文件中只有如下一段字符:abcdefg。则:System.out在屏幕上打印( )。     
A. a
B. b
C. 97
D. 98
[单项选择] 在j2ee中,某一Java程序中有如下代码:  DataInputStream din =new DataInputStream(new BufferedInputStream(new FileInputStream("employee.dat"))); System.out.print(din.readByte());  假设在employee.dat文件中只有如下一段字符:abcdefg.则:System.out在屏幕上打印()  
A.  a
B.  b
C. 97
D. 98
[单项选择] 在Java中,  类Animal中的方法 printA()定义如下:    public void printA()  {  int a = 10;   int result = 10 % 3;  System.out.println(result); }  在类Dog中方法printA()定义如下:   public void printA() {  int a = 10;   System.out.println( a / 3 ); }   Dog类的定义如下:  class Dog extends Animal{…}.    Animal animal = new Dog();   animal.printA();  以上语句输出为()。 
A. 0
B. 1
C. 2
D. 3
E. 3.3333
[多项选择] Given a file GrizzlyBear.java:  1. package animals.mammals;  2.  3. public class GrizzlyBear extends Bear {  4. void hunt() {  5. Salmon s = findSalmon();  6. s.consume();  7. }  8. }  and another file, Salmon.java:  1. package animals.fish; 2.  3. public class Salmon extends Fish {  4. void consume() { /* do stuff */ }  5. }  Assume both classes are defined in the correct directories for theft packages, and that the Mammal class correctly defines the findSalmon() method. Which two changes allow this code to compile correctly?()
A.  add public to the start of line 4 in Salmon.java
B.  add public to the start of line 4 in GrizzlyBear.java
C.  add import animals.mammals.*; at line 2 in Salmon.java
D.  add import animals.fish.*; at line 2 in GrizzlyBear.java
E.  add import animals.fish.Salmon.*; at line 2 in GrizzlyBear.java
F.  add import animals.mammals.GrizzlyBear.*;at line 2 in Salmon.java
[多项选择] 现有如下命令行:  java -showversion ShowVersion ShowVERSION SHOWVERSION  哪三个是对的?()
A. 这是一个合法调用
B. 这是一个非法调用
C. 该调用包含一个选项
D. 该调用包含两个参数
[单项选择] ClassOne.java   package com.abc.pkg1;   public class ClassOne {   private char var = ‘a‘;   char getVar() {return var;}   }   ClassTest.java   package com.abc.pkg2;   import com.abc.pkg1.ClassOne;   public class ClassTest extends ClassOne {  public static void main(Stringargs) {  char a = new ClassOne().getVar();  char b = new ClassTest().getVar();   }   }   What is the result?()  
A.  Compilation will fail.
B.  Compilation succeeds and no exceptions are thrown.
C.  Compilation succeeds but an exception is thrown at line 5 in ClassTest.java.
D.  Compilation succeeds but an exception is thrown at line 6 in ClassTest.java.
[单项选择] 分析下列Java代码:   class A {  public static void main(String[] args)    {   method();   }      static void method()    {     try    {  System.out.println("Hello");    System.exit(0);    }    finally   {  System.out.println("good-bye");  }   }    }  编译运行后,输出结果是()。     
A. "Hello"
B. "good-bye"
C. "Hello"后面是"good-bye"
D. 代码不能编译
[单项选择] 在Java语言中,小明在他的包mypackage中定义了类My_Class, 在mypackage的子包mysubpackage中也有个类My_Class。小明用 import mypackage.*; 引入包,  执行其中的语句: My_Class NewClass = new My_Class(); 时,将发生()。 
A. 创建一个类mypackage.My_Class的对象
B. 创建一个类mypackage.mysubpackage.My_Class的对象
C. 该语句是错误的
D. 创建一个类mypackage.My_Class的对象和一个类mypackage.mysubpackage.My_Class的对象

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

截图扫码使用小程序[完全免费查看答案]
请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码