单选题在j2ee中,以下是firevetoablechange方法的正确的原型的是()A public void fireVetoableChange(Object  oldValue,Object newValue)Bpublic void fireVetoableChange(String  propertyName,Object newValue)Cpublic void fireVetoableChange(String  propertyName, Object  oldValue ,Objec

题目
单选题
在j2ee中,以下是firevetoablechange方法的正确的原型的是()
A

public void fireVetoableChange(Object  oldValue,Object newValue)

B

 public void fireVetoableChange(String  propertyName,Object newValue)

C

 public void fireVetoableChange(String  propertyName, Object  oldValue ,Object newValue)throws PropertyVetoException

D

 public void fireVetoableChange(String  propertyName, Object  oldValue ,Object newValue)


相似考题

1.试题六(共 15分)阅读以下说明和Java代码,将应填入 (n) 处的字句写在答题纸的对应栏内。【说明】已知类 LinkedList 表示列表类,该类具有四个方法:addElement()、lastElement()、umberOfElement()以及removeLastElement()。四个方法的含义分别为:void addElement(Object): 在列表尾部添加一个对象;Object lastElement(): 返回列表尾部对象;int numberOfElement(): 返回列表中对象个数;void removeLastElement(): 删除列表尾部的对象。现需要借助LinkedList来实现一个Stack栈类, Java代码1和Java代码2分别采用继承和组合的方式实现。【Java代码1】public class Stack extends LinkedList{public void push(Object o){ //压栈addElement(o);}public Object peek(){ //获取栈顶元素return (1) ;}public boolean isEmpty(){ //判断栈是否为空return numberOfElement() == 0;}public Object pop(){ //弹栈Object o = lastElement();(2) ;return o;}}【Java代码2】public class Stack {private (3) ;public Stack(){list = new LinkedList();}public void push(Object o){list.addElement(o);}public Object peek(){//获取栈顶元素return list. (4) ;}public boolean isEmpty(){//判断栈是否为空return list.numberOfElement() == 0;}public Object pop(){ //弹栈Object o = list.lastElement();list.removeLastElement();return o;}}【问题】若类LinkedList新增加了一个公有的方法removeElement(int index),用于删除列表中第index个元素,则在用继承和组合两种实现栈类Stack的方式中,哪种方式下Stack对象可访问方法removeElement(int index)? (5) (A. 继承 B. 组合)

3.阅读以下说明和Java代码,回答问题[说明]在某些系统中,存在非常复杂的对象,可以采用循序渐进的方式进行组合将小对象组合,成复杂的对象。以下实例展示了Builder(生成器)模式。该实例用来建立“文件”,文件内容包括:一个标题、一串字符以及一些有项目符号的项目。Builder类规定组成文件的方法,Director类利用这个方法产生一份具体的文件。图6-1显示了各个类间的关系。以下是Java语言实现,能够正确编译通过。[Java代码]//Builder. java文件public (1) class Builder {public abstract void makeTitle(String title);public abstract void makeString(String str);public abstract void makeItems(String[] items);public abstract Object getResult();}//Director. java文件public class Director{private (2) builder;public Director(Builder builder){this. builder = builder;}public Object construct(){builder.makeTitle("Greeting");builder.makeString("从早上到白天结束");builder.makeItems(new String[]{"早安", "午安",});builder.makeString("到了晚上");builder.makeItems(new String[]("晚安", "好梦",});return builder.getResult();}}//TextBuilder.java文件public class TextBuilder (3) Builder{private StringBuffer buffer = new StringBuffer();public void makeTitle(String title){buffer.append("『" + title + "』"\n\n");}public void makeString(String str){buffer.append('■' + str + "\n\n ");}public void makeItems(String[] items){for(int i = 0; i< (4) ; i++){buffer.append('·' + items[i] + "\n");}buffer.append("\n");}public Object getResult(){return buffer.toString();}}//Main.java文件public class Main {public static void main(String[] args) {Director director = new Director(new TextBuilder());String result = (String)director. (5) ;System.out.println(result);

更多“单选题在j2ee中,以下是firevetoablechange方法的正确的原型的是()A public void fireVetoableChange(Object  oldValue,Object newValue)B  public void fireVetoableChange(String  propertyName,Object newValue)C  public void fireVetoableChange(String  propertyName, Object  oldValue ,O”相关问题
  • 第1题:

    以下哪个是Java应用程序main方法的有效定义?

    A. public static void main();

    B. public static void main( String args );

    C. public static void main( String args[] );

    D. public static void main( Graphics g );

    E. public static boolean main( String a[] );


    正确答案:C

  • 第2题:

    public class ItemTest {  private final mt id;  public ItemTest(int id) { this.id = id; }  public void updateId(int newId) { id = newId; }  public static void main(String[] args) {  ItemTest fa = new ItemTest(42);  fa.updateId(69);  System.out.println(fa.id);  }  }  What is the result?() 

    • A、 Compilation fails.
    • B、 An exception is thrown at runtime.
    • C、 The attribute id in the Item object remains unchanged.
    • D、 The attribute id in the Item object is modified to the new value.
    • E、 A new Item object is created with the preferred value in the id attribute.

    正确答案:A

  • 第3题:

    下列有关main()方法的签名正确的是哪些?()

    • A、 public static void main(String[] args){}
    • B、 public static void main(){}
    • C、 public static void main(String args[]){}
    • D、 public void static main(String[] args){}

    正确答案:A,C

  • 第4题:

    Object类的finalize()方法是如何声明的()。

    • A、public void finalize()
    • B、protected int finalize()
    • C、C.protected void finalize(int
    • D、protected void finalize()throws Throwable

    正确答案:D

  • 第5题:

    1. public class GC {  2. private Object o;  3. private void doSomethingElse(Object obj) { o = obj; }  4. public void doSomething() {  5. Object o = new Object();  6. doSomethingElse(o);  7. o = new Object();  8. doSomethingElse(null);  9.o=null;  10. }  11. }  When the doSomething method is called, after which line does the Object created in line 5 become available for garbage collection?() 

    • A、 Line 5
    • B、 Line 6
    • C、 Line 7
    • D、 Line 8
    • E、 Line 9
    • F、 Line 10

    正确答案:D

  • 第6题:

    声明Java独立应用程序main()方法时,正确表达是()。

    • A、public static void main(String[]args){…}
    • B、private static void main(String args[]){…}
    • C、public void main(String args[]){…}
    • D、public static void main(){…}

    正确答案:A

  • 第7题:

    下列代码正确的是哪项?() 

    • A、 public class Session implements Runnable, Clonable{   public void run ();public Object clone () ; }
    • B、 public class Session extends Runnable, Cloneable {  public void run() {/*dosomething*/}       public Object clone() {/*make a copy*/} }
    • C、 public abstract class Session implements Runnable, Clonable {       public void run() {/*do something*/}       public Object clone() {/*make a copy*/}        }
    • D、 public class Session implements Runnable, implements Clonable {       public void run() {/*do something*/}       public Object clone() {/*make a copy*/}       }

    正确答案:C

  • 第8题:

    Which three will compile and run without exception?()

    • A、private synchronized Object o;
    • B、void go(){   synchronized(){/* code here */}
    • C、public synchronized void go(){/* code here */}
    • D、private synchronized(this) void go(){/* code here */}
    • E、void go(){   synchronized(Object.class){/* code here */}
    • F、void go(){   Object o = new Object();   synchronized(o){/* code here */}

    正确答案:C,E,F

  • 第9题:

    单选题
    1.public class GC{ 2.private Objec to; 3.private void doSomethingElse(Object obj){o=obj;} 4.public void doSomething(){ 5.Object o=new Object(); 6.doSomethingElse(o); 7.o=new Object(); 8.doSomethingElse(null); 9.o=null; 10.} 11.} When the doSomething method is called,after which line does the Object created in line 5 become available for garbage collection?()
    A

    Line5

    B

    Line6

    C

    Line7

    D

    Line8

    E

    Line9

    F

    Line10


    正确答案: A
    解析: 暂无解析

  • 第10题:

    单选题
    下列代码正确的是哪项?()
    A

     public class Session implements Runnable, Clonable{   public void run ();public Object clone () ; }

    B

     public class Session extends Runnable, Cloneable {  public void run() {/*dosomething*/}       public Object clone() {/*make a copy*/} }

    C

     public abstract class Session implements Runnable, Clonable {       public void run() {/*do something*/}       public Object clone() {/*make a copy*/}        }

    D

     public class Session implements Runnable, implements Clonable {       public void run() {/*do something*/}       public Object clone() {/*make a copy*/}       }


    正确答案: A
    解析: 暂无解析

  • 第11题:

    单选题
    public class Test {  public static void main(String args[]) {  class Foo {  public int i = 3; }  Object o = (Object)new Foo();   Foo foo = (Foo)o;  System.out.println(“i = “ + foo.i); }  }  What is the result?()
    A

     i = 3

    B

     Compilation fails.

    C

     A ClassCastException is thrown at line 6.

    D

     A ClassCastException is thrown at line 7.


    正确答案: D
    解析: 暂无解析

  • 第12题:

    单选题
    在J2EE中,以下是firePropertyChange的原型,正确的是()。
    A

    public void firePropertyChange(PropertyChangeListener l,String oldValue, String newValue)

    B

    public void firePropertyChange(String propertyName, Object oldValue, Object newValue)

    C

    public void firePropertyChange(PropertyChangeSupport changes)

    D

    public void firePropertyChange(Object oldValue, Object newValue)


    正确答案: A
    解析: 暂无解析

  • 第13题:

    以下是JAVA中正确的入口方法是? () 

    • A、 public static void main(String[] args){}
    • B、 public static void main(String args){}
    • C、 public void main(String[] args){}
    • D、 public static int main(String[] args){}

    正确答案:A

  • 第14题:

    public class Test {   public static void main (String args) {   class Foo {   public int i = 3;  }   Object o = (Object) new Foo();   Foo foo = (Foo)o;   System.out.printIn(foo. i);  }   }   What is the result?()  

    • A、 Compilation will fail.
    • B、 Compilation will succeed and the program will print “3”
    • C、 Compilation will succeed but the program will throw a ClassCastException at line 6.
    • D、 Compilation will succeed but the program will throw a ClassCastException at line 7.

    正确答案:B

  • 第15题:

    在j2ee中,以下是firevetoablechange方法的正确的原型的是() 

    • A、public void fireVetoableChange(Object  oldValue,Object newValue)
    • B、 public void fireVetoableChange(String  propertyName,Object newValue)
    • C、 public void fireVetoableChange(String  propertyName, Object  oldValue ,Object newValue)throws PropertyVetoException
    • D、 public void fireVetoableChange(String  propertyName, Object  oldValue ,Object newValue)

    正确答案:C

  • 第16题:

    以下哪些方法在Object类中定义()。

    • A、toString()
    • B、equals(Objecto)
    • C、public static void main(String[]args)
    • D、System.out.println()
    • E、wait()

    正确答案:A,B,E

  • 第17题:

    main方法是Java程序执行的入口点,关于main方法的方法头以下哪项是合法的()?

    • A、public static void main( )
    • B、public static void main( String args[] )
    • C、public static int main(String [] arg )
    • D、public void main(String arg[] )

    正确答案:B

  • 第18题:

    在J2EE中,以下是firePropertyChange的原型,正确的是()。 

    • A、public void firePropertyChange(PropertyChangeListener l,String oldValue, String newValue)
    • B、public void firePropertyChange(String propertyName, Object oldValue, Object newValue)
    • C、public void firePropertyChange(PropertyChangeSupport changes)
    • D、public void firePropertyChange(Object oldValue, Object newValue)

    正确答案:B

  • 第19题:

    public class Test {  public static void main(String args[]) {  class Foo {  public int i = 3; }  Object o = (Object)new Foo();   Foo foo = (Foo)o;  System.out.println(“i = “ + foo.i); }  }  What is the result?()  

    • A、 i = 3
    • B、 Compilation fails.
    • C、 A ClassCastException is thrown at line 6.
    • D、 A ClassCastException is thrown at line 7.

    正确答案:A

  • 第20题:

    单选题
    public class Test {   public static void main (String args) {   class Foo {   public int i = 3;  }   Object o = (Object) new Foo();   Foo foo = (Foo)o;   System.out.printIn(foo. i);  }   }   What is the result?()
    A

     Compilation will fail.

    B

     Compilation will succeed and the program will print “3”

    C

     Compilation will succeed but the program will throw a ClassCastException at line 6.

    D

     Compilation will succeed but the program will throw a ClassCastException at line 7.


    正确答案: D
    解析: 暂无解析

  • 第21题:

    单选题
    1. public class GC {  2. private Object o;  3. private void doSomethingElse(Object obj) { o = obj; }  4. public void doSomething() {  5. Object o = new Object();  6. doSomethingElse(o);  7. o = new Object();  8. doSomethingElse(null);  9.o=null;  10. }  11. }  When the doSomething method is called, after which line does the Object created in line 5 become available for garbage collection?()
    A

     Line 5

    B

     Line 6

    C

     Line 7

    D

     Line 8

    E

     Line 9

    F

     Line 10


    正确答案: A
    解析: 暂无解析

  • 第22题:

    单选题
    public class ItemTest {  private final mt id;  public ItemTest(int id) { this.id = id; }  public void updateId(int newId) { id = newId; }  public static void main(String[] args) {  ItemTest fa = new ItemTest(42);  fa.updateId(69);  System.out.println(fa.id);  }  }  What is the result?()
    A

     Compilation fails.

    B

     An exception is thrown at runtime.

    C

     The attribute id in the Item object remains unchanged.

    D

     The attribute id in the Item object is modified to the new value.

    E

     A new Item object is created with the preferred value in the id attribute.


    正确答案: C
    解析: 暂无解析

  • 第23题:

    单选题
    以下是JAVA中正确的入口方法是? ()
    A

     public static void main(String[] args){}

    B

     public static void main(String args){}

    C

     public void main(String[] args){}

    D

     public static int main(String[] args){}


    正确答案: D
    解析: 暂无解析

  • 第24题:

    单选题
    在j2ee中,以下是firevetoablechange方法的正确的原型的是()
    A

    public void fireVetoableChange(Object  oldValue,Object newValue)

    B

     public void fireVetoableChange(String  propertyName,Object newValue)

    C

     public void fireVetoableChange(String  propertyName, Object  oldValue ,Object newValue)throws PropertyVetoException

    D

     public void fireVetoableChange(String  propertyName, Object  oldValue ,Object newValue)


    正确答案: B
    解析: 暂无解析