网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

Part of the signature of the String class is:

class String {

....

};

Other part of signature and implementation is completed by you.


参考答案

更多 “ Part of the signature of the String class is:class String {....};Other part of signature and implementation is completed by you. ” 相关考题
考题 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.

考题 You are developing a Windows Comunication Foundation (WCF) service that is used to check the status of orders placed by customers.The following code segment is part of your service.(Line numbers are included for reference only.)01 [ServiceContract]02 public interface IStatus03 {04 [OperationContract]05 int GetOrderStatus(string orderNumber);06 }0708 class OrderService : IStatus09 {10 public int GetOrderStatus(string orderNumber)11 {12 ...13 }14 }1516 class Program17 {18 static void Main(string[] args)19 {202122 host.Open();23 ...24 }25 }You need to ensure that the service always listens at net.pipe://SupplyChainServer/Pipe.What should you do?()A.B.C.D.

考题 阅读下列程序说明和C++程序,把应填入其中(n)处的字句,写对应栏内。【说明】下面的程序实现了类String的构造函数、析构函数和赋值函数。已知类String的原型为:class String{public:String(coust char * str = NULL); //普通构造函数String( const String other); //拷贝构造函数~String(void); //析构函数String perate =(const String other); //赋值函数private:char * m_data; // 用于保存字符串};//String 的析构函数String:: ~String (void){(1);}//String 的普通构造函数String: :String( const char * str){if (2){m_data = new char[1];*m_data = '\0';}else{int length = strlen(str);m_data = new ehar[ length + 1 ];strepy(m_data, str);}}//拷贝的构造函数String:: String( const String other){ int length = strlen(other. m_data);m_data = new char[ length + 1 ];strepy(m_data, other, m_data); //赋值函数String String::operate = (eonst String other) //{if (3)return * this;delete [] m_clara; //释放原有的内存资源int length = strlen( other, m_data);m_data = new chart length + 1 ];(4);return (5);}

考题 public class Something {public static void main(String[] args) {Other o = new Other();new Something().addOne(o);}public void addOne(final Other o) {o.i++;}}class Other {public int i;}和上面的很相似,都是关于final 的问题,这有错吗?

考题 已知类 String 的原型为class string{public:string(const char *str=null);//普通构造函数string(const string other);//拷贝构造函数---string(void);string operate=(const string other);//赋值函数private:char * m-data;//用于保存字符串};请编写 string 的上述4 个函数

考题 编写类 String 的构造函数、析构函数和赋值函数已知类 String的原型为:class String{public:String(const char *str = NULL); // 普通构造函数String(const String other); // 拷贝构造函数~ String(void); // 析构函数String perate =(const String other); // 赋值函数private:char *m_data; // 用于保存字符串};请编写 String的上述 4 个函数。

考题 类Account中字段声明正确的是?()    A、class Account{  name;  amount;  }B、class Account{  String name;  double amount;  }C、class Account{  String name=1.0;  double amount=”Mike”;  }D、class Account{  String name=”Mike”,double amount=1000.0;  }

考题 Which two allow the class Thing to be instantiated using new Thing()?A、 public class Thing { }B、 public class Thing { public Thing() {} }C、 public class Thing { public Thing(void) {} }D、 public class Thing { public Thing(String s) {} }E、 public class Thing { public void Thing() {} public Thing(String s) {} }

考题 class Mineral {   static String shiny() { return "1"; }   }   class Granite extends Mineral {   public static void main(String [] args) {   String s = shiny() + getShiny();   s = s + super.shiny();   System.out.println(s);   }   static String getShiny() { return shiny(); }   }   结果为:()  A、3B、12C、111D、编译失败

考题 public class Employee{       private String name;  public Employee(String name){           this.name = name;      }  public String getName(){         return name;      } }  public class Manager extends Employee{       private String department;  public Manager(String name,String department){          this.department = department;          super(name);  System.out.println(getName());      }  }  执行语句new Manager(“smith”,”SALES”)后程序的输出是哪项?() A、 smithB、 nullC、 SALESD、 编译错误

考题 A programmer is designing a class to encapsulate the information about an inventory item. A JavaBeans component is needed to do this. The Inventoryltem class has private instance variables to store the item information:  10. private int itemId;  11. private String name;  12. private String description;  Which method signature follows the JavaBeans naming standards for modifying the itemld instance variable?() A、 itemID(int itemId)B、 update(int itemId)C、 setItemId(int itemId)D、 mutateItemId(int itemId)E、 updateItemID(int itemId)

考题 Given the uncompleted code of a class:     class Person {  String name, department;     int age;  public Person(String n){  name = n; }  public Person(String n, int a){  name = n;  age = a;  }  public Person(String n, String d, int a) {  // doing the same as two arguments version of constructor     // including assignment name=n,age=a    department = d;     }     }  Which expression can be added at the "doing the same as..." part of the constructor?() A、 Person(n,a);B、 this(Person(n,a));C、 this(n,a);D、 this(name,age);

考题 现有:  class Guy {String greet()    {return "hi";  }  }  class Cowboy extends Guy  (  String greet()    (  return "howdy  ¨;    )  )  class Surfer extends Guy  (String greet()    (return "dude! ";)) class Greetings  {  public static void main (String  []  args)    {  Guy  []  guys =  ( new Guy(), new Cowboy(), new Surfer()  );  for (Guy g:  guys) System.out.print (g.greet()};  }  }  结果为:() A、 hi howdy dude!B、运行时异常被抛出。C、第7行出现一个错误,编译失败。D、第8行出现一个错误,编译失败。

考题 Which methods from the String and StringBuffer classes modify the object on which they are called?()  A、The charAt() method of the String class.B、The toUpperCase() method of the String class.C、The replace() method of the String class.D、The reverse() method of the StringBuffer class.E、The length() method of the StringBuffer class.

考题 public class Plant {  private String name;  public Plant(String name) { this.name = name; }  public String getName() { return name; }  }  public class Tree extends Plant {  public void growFruit() { }  public void dropLeaves() { }  }  Which is true?() A、 The code will compile without changes.B、 The code will compile if public Tree() { Plant(); } is added to the Tree class.C、 The code will compile if public Plant() { Tree(); } is added to the Plant class.D、 The code will compile if public Plant() { this(”fern”); } is added to the Plant class.E、 The code will compile if public Plant() { Plant(”fern”); } is added to the Plant class.

考题 Given the following code, write a line of code that, when inserted at the indicated location, will make the overriding method in Extension invoke the overridden method in class Base on the current object.   class Base {   public void print( ) {   System.out.println("base");   }   }   class Extention extends Base {   public void print( ) {   System.out.println("extension");   // insert line of implementation here   }   }   public class Q294d {   public static void main(String args[]) {   Extention ext = new Extention( );   ext.print( );   }   }   Fill in a single line of implementation.()

考题 public class Employee{   private String name;   public Employee(String name){   this.name = name;  }   public String getName(){   return name;  }  }   public class Manager extends Employee{   public Manager(String name){   System.out.println(getName());  }  }   执行语句new Manager(“smith”)后程序的输出是哪项?() A、 smithB、 nullC、 编译错误D、 name

考题 Given an EL function declared with:11.  12.spin 13.com.example.Spinner 14. 15.java.lang.String spinIt() 16. 17. Which two are true?()A、The function method must have the signature: public String spin().B、The method must be mapped to the logical name "spin" in the web.xml file.C、The function method must have the signature: public String spinIt().D、The function method must have the signature public static String spin().E、The function method must have the signature: public static String spinIt().F、The function class must be named Spinner, and must be in the package com.example.

考题 If you use ALTER DISKGROUP ... ADD DISK and specify a wildcard for the discovery string, what happens to disks that are already a part of the same or another disk group?()  A、 The command fails unless you specify the FORCE option.B、 The command fails unless you specify the REUSE option.C、 The command must be reissued with a more specific discovery string.D、 The other disks, already part of the disk group,are ignored.

考题 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)

考题 单选题public class Plant {  private String name;  public Plant(String name) { this.name = name; }  public String getName() { return name; }  }  public class Tree extends Plant {  public void growFruit() { }  public void dropLeaves() { }  }  Which is true?()A  The code will compile without changes.B  The code will compile if public Tree() { Plant(); } is added to the Tree class.C  The code will compile if public Plant() { Tree(); } is added to the Plant class.D  The code will compile if public Plant() { this(”fern”); } is added to the Plant class.E  The code will compile if public Plant() { Plant(”fern”); } is added to the Plant class.

考题 多选题Given an EL function declared with:11.  12.spin 13.com.example.Spinner 14. 15.java.lang.String spinIt() 16. 17. Which two are true?()AThe function method must have the signature: public String spin().BThe method must be mapped to the logical name spin in the web.xml file.CThe function method must have the signature: public String spinIt().DThe function method must have the signature public static String spin().EThe function method must have the signature: public static String spinIt().FThe function class must be named Spinner, and must be in the package com.example.

考题 单选题public class Employee{       private String name;  public Employee(String name){           this.name = name;      }  public String getName(){         return name;      } }  public class Manager extends Employee{       public Manager(String name){          System.out.println(getName());      } }  执行语句new Manager(“smith”)后程序的输出是哪项?()A  smithB  nullC  编译错误D  name

考题 单选题If you use ALTER DISKGROUP ... ADD DISK and specify a wildcard for the discovery string, what happens to disks that are already a part of the same or another disk group?()A  The command fails unless you specify the FORCE option.B  The command fails unless you specify the REUSE option.C  The command must be reissued with a more specific discovery string.D  The other disks, already part of the disk group,are ignored.

考题 单选题Which methods from the String and StringBuffer classes modify the object on which they are called?()A The charAt() method of the String class.B The toUpperCase() method of the String class.C The replace() method of the String class.D The reverse() method of the StringBuffer class.E The length() method of the StringBuffer class.

考题 单选题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)

考题 多选题Which two allow the class Thing to be instantiated using new Thing()?Apublic class Thing { }Bpublic class Thing { public Thing() {} }Cpublic class Thing { public Thing(void) {} }Dpublic class Thing { public Thing(String s) {} }Epublic class Thing { public void Thing() {} public Thing(String s) {} }