单选题现自:  class Car implements Serializable  ()      class Ford extends Car  {}  如果试图序列化一个Ford实例,结果为()A编译失败B两个对象被序列化C—个对象被序列化D运行时异常被抛出

单选题
现自:  class Car implements Serializable  ()      class Ford extends Car  {}  如果试图序列化一个Ford实例,结果为()
A

编译失败

B

两个对象被序列化

C

—个对象被序列化

D

运行时异常被抛出


参考解析

解析: 暂无解析

相关考题:

下列关于Test类的定义中,正确的是______。A) class Test implements Runnabte{public void run(){}public void someMethod(){}B) class Test implements Rnuuable{public void run();}C) class Test implements Rnuuable{public void someMethod();}D) class Test implements Rnuuable{public void someMethod();{}}A.B.C.D.

下列哪个方法可用于创建一个可运行的类? ( )A.public class X implements Runable {public void run(){...,.,}}B.public class X implements Thread {public void run(){......}}C.public class X implements Thread {public int run(){……}}D.public class X implements Runable {protected void run(){.....}}

You have recently created a serializable class named Vehicle.The class is shown below:[Serializable]public class Vehicle{public string VIN;public string Make;public string Model;public string Year;}You are planning to create a custom formatter class to control the formatting of Vehicle objects when they are serialized.You need to ensure that is achieved with as little development effort as possible.What should you do?()A.B.C.D.

现有两个类A,B,以下描述中表示B继承自A的是 ( )A.class A extends BB.class B implements AC.class A implements BD.class B extends A

若已定义了类Vehicle,则下列派生类定义中,错误的是A.class Car:Vehicle{/*类体略*/);B.class Car:public Car{/*类体略*/);C.class Car:public Vehicle{/*类体略*/);D.class Car:virtual public Vehicle{/*类体略*/);

阅读下列说明和Java代码,将应填入(n)处的字句写在答题纸的对应栏内。【说明】某软件公司欲开发一款汽车竞速类游戏,需要模拟长轮胎和短轮胎急刹车时在路面上留 下的不同痕迹,并考虑后续能模拟更多种轮胎急刹车时的痕迹。现采用策略(Strategy)设计模式来实现该需求,所设计的类图如图 5-1 所示。【Java代码】import java.util.*; interface BrakeBehavior{public (1) ;/*其余代码省略*/}class LongWheelBrake implements BrakeBehavior{public void stop(){System.out.println("模拟长轮胎刹车痕迹! ");}/*其余代码省略*/}class ShortWheelBrake implements BrakeBehavior {public void stop(){System.out.println("模拟短轮胎刹车痕迹! ");}/*其余代码省略 */}abstract class Car{protected (2) wheel;public void brake(){ (3) ;}/*其余代码省略*/}class ShortWheelCar extends Car {public ShortWheelCar(BrakeBehavior behavior){(4) ; } /*其余代码省略*/}class StrategyTest{public static void main(String[]args){BrakeBehaviorbrake =new ShortWheelBrake();ShortWheelCar car1= new ShortWheelCar(brake);car1. (5) ;}}

现自:  class Car implements Serializable  ()      class Ford extends Car  {}  如果试图序列化一个Ford实例,结果为()  A、编译失败B、两个对象被序列化C、—个对象被序列化D、运行时异常被抛出

interface Data { public void load(); }  abstract class Info { public abstract void load(); }  Which class correctly uses the Data interface and Info class?() A、 public class Employee extends Info implements Data { public void load() { /*do something*/ } }B、 public class Employee implements Info extends Data { public void load() { /*do something*/ } }C、 public class Employee extends Info implements Data { public void load() { /*do something */ } public void Info.load() { /*do something*/ } }D、 public class Employee implements Info extends Data { public void Data.load() { /*dsomething */ } public void load() { /*do something */ } }E、 public class Employee implements Info extends Data { public void load() { /*do something */ } public void Info.load(){ /*do something*/ } }F、 public class Employee extends Info implements Data{ public void Data.load() { /*do something*/ } public void Info.load() { /*do something*/ } }

现在有两个类A、B,以下描述中表示B继承自A的是()A、class A extends BB、class B implements AC、class A implementsD、class B extends A

现自:  1.  interface Color {  }      2. interface Weight  {  }      3.  //insert code here    和以下足六个声明:  class Boat extends Color, extends Weight  {  }     class Boat extends Color and Weight  {  }      class Boat extends Color, Weight  {  }  class Boat implements Color,  implements Weight  {  }     class Boat implements Color and Weight  {  }      class Boat implements Color, Weight  {  }    分别插入到第3行,有多少行可以编译? () A、  0B、  1C、  2D、  3

下列代码正确的是哪项?() 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*/}       }

Which Man class properly represents the relationship "Man has a best friend who is a Dog"?()A、class Man extends Dog{}B、class Man implements Dog{}C、class Man{private BestFriend dog;}D、class Man{private Dog bestFriend;}E、class Man{private Dog;}F、class Man{private BestFriend;}

Which two demonstrate an “is a” relationship?()   A、 public interface Person { }  public class Employee extends Person { }B、 public interface Shape { }  public class Employee extends Shape { }C、 public interface Color { }  public class Employee extends Color { }D、 public class Species { }  public class Animal (private Species species;)E、 interface Component { }  Class Container implements Component ( Private Component[ ]children;  )

class Car implements Serializable { }   class Ford extends Car { }   如果试图序列化一个Ford实例,结果为()  A、编译失败B、一个对象被序列化C、两个对象被序列化D、运行时异常被抛出

现有:  class Pet implements Serializable  {      Collar c= new Collar();      }  class Collar implements Serializable  {      collarPart cpl=new CollarPart ("handle");      CollarPart cp2=new CollarPart ("clip");      }     class CollarPart implements Serializable()  如果Pet实例被序列化,则多少对象将被序列化?()    A、0B、1C、2D、3E、4F、5

public abstract class Shape {  private int x;  private int y;  public abstract void draw();  public void setAnchor(int x, int y) {  this.x = x;  this.y = y;  }  }  Which two classes use the Shape class correctly?()A、 public class Circle implements Shape { private int radius; }B、 public abstract class Circle extends Shape { private int radius; }C、 public class Circle extends Shape { private int radius; public void draw(); }D、 public abstract class Circle implements Shape { private int radius; public void draw(); }E、 public class Circle extends Shape { private int radius;public void draw() {/* code here */} }F、 public abstract class Circle implements Shape { private int radius;public void draw() { / code here */ } }

Which Man clsss properly represents the relationship "Man has a best friend who is a Dog"?()A、class Man extends Dog { }B、class Man implements Dog { }C、class Man { private BestFriend dog; }D、class Man { private Dog bestFriend; }E、class Man { private Dog; }F、class Man { private BestFriend; }

You work as the application developer at Hi-Tech.com. You create a new custom dictionary named MyDictionary. Choose the code segment which will ensure that MyDictionary is type safe?()A、 Class MyDictionary Implements Dictionary (Of String,String)B、 Class MyDictionary Inherits HashTableC、 Class MyDictionary Implements IDictionaryD、 Class MyDictionary End Class Dim t as New Dictionary (Of String, String) Dim dict As MyDIctionary= CType (t,MyDictionary)

单选题下列代码正确的是哪项?()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*/}       }

单选题interface Data { public void load(); }  abstract class Info { public abstract void load(); }  Which class correctly uses the Data interface and Info class?()A public class Employee extends Info implements Data { public void load() { /*do something*/ } }B public class Employee implements Info extends Data { public void load() { /*do something*/ } }C public class Employee extends Info implements Data { public void load() { /*do something */ } public void Info.load() { /*do something*/ } }D public class Employee implements Info extends Data { public void Data.load() { /*dsomething */ } public void load() { /*do something */ } }E public class Employee implements Info extends Data { public void load() { /*do something */ } public void Info.load(){ /*do something*/ } }F public class Employee extends Info implements Data{ public void Data.load() { /*do something*/ } public void Info.load() { /*do something*/ } }

多选题public abstract class Shape {  private int x;  private int y;  public abstract void draw();  public void setAnchor(int x, int y) {  this.x = x;  this.y = y;  }  }  Which two classes use the Shape class correctly?()Apublic class Circle implements Shape { private int radius; }Bpublic abstract class Circle extends Shape { private int radius; }Cpublic class Circle extends Shape { private int radius; public void draw(); }Dpublic abstract class Circle implements Shape { private int radius; public void draw(); }Epublic class Circle extends Shape { private int radius;public void draw() {/* code here */} }Fpublic abstract class Circle implements Shape { private int radius;public void draw() { / code here */ } }

单选题Which Man class properly represents the relationship “Man has a best friend who is a Dog”?()A class Man extends Dog { }B class Man implements Dog { }C class Man { private BestFriend dog; }D class Man { private Dog bestFriend; }E class Man { private Dog }F class Man { private BestFriend }

单选题class Car implements Serializable { }   class Ford extends Car { }   如果试图序列化一个Ford实例,结果为()A编译失败B一个对象被序列化C两个对象被序列化D运行时异常被抛出

多选题Given a class whose instances, when found in a collection of objects, are sorted by using the compareTo() method, which two statements are true?()AThe class implements java.lang.Comparable.BThe class implements java.util.Comparator.CThe interface used to implement sorting allows this class to define only one sort sequence.DThe interface used to implement sorting allows this class to define many different sort sequences.

单选题现有:  1. interface Animal {  2. void eat();  3. }  4.  5. // insert code here  6.  7. public class HouseCat extends Feline {  8. public void eat() { }  9. }   和五个声明:  abstract class Feline implements Animal { }  abstract class Feline implements Animal { void eat(); }  abstract class Feline implements Animal { public void eat(); }  abstract class Feline implements Animal { public void eat() { } }  abstract class Feline implements Animal { abstract public void eat(); }  分别插入到第5行,有几个可以通过编译?()A0B1C2D3

单选题现自:  1.  interface Color {  }      2. interface Weight  {  }      3.  //insert code here    和以下足六个声明:  class Boat extends Color, extends Weight  {  }     class Boat extends Color and Weight  {  }      class Boat extends Color, Weight  {  }  class Boat implements Color,  implements Weight  {  }     class Boat implements Color and Weight  {  }      class Boat implements Color, Weight  {  }    分别插入到第3行,有多少行可以编译? ()A  0B  1C  2D  3

单选题现自:  class Car implements Serializable  ()      class Ford extends Car  {}  如果试图序列化一个Ford实例,结果为()A编译失败B两个对象被序列化C—个对象被序列化D运行时异常被抛出

单选题现有:  interface Animal {       void eat () ;       }       //insert code here       public class HouseCat extends Feline {       public void eat() { }       }  和五个申明  abstract class Feline implements Animal { }  abstract  class  Feline  implements  Animal  {  void eat () ;  }  abstract class Feline implements Animal { public void eat();}  abstract class Feline implements Animal { public void eat() {}  }  abstract class Feline implements Animal { abstract public void eat();} 结果为:()A1B2C3D4