网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
继承自string的MyString 通过码
参考答案和解析
881bf51771e38e6ce2ed8119dd7fdfeb23b7da6881f01ceed01de43a4b6fd180
更多 “继承自string的MyString 通过码” 相关考题
考题
在自定义的类MyClass中,应重载继承自System.Object类的哪个方法,以实现自定义的哈希算法?
A.Get Hash CodeB.EqualsC.Reference EqualsD.To String
考题
下列语句中,正确的是( )。A.char*myString="Hello-World!";B.char myString="Hello-World!";C.char myString[11]="Hello-World!";D.char myString[12]="Hello-World!";
考题
有如下的程序: include include using namespace st
有如下的程序: #include<cstring> #include<iostream> using namespace std; class MyString { public: MyString(const char*s); ~MyString(){delete[]data;} Protected: unsigned len; char*data; }; MyString::MyString(const char*s) { len=strlen(s); data=new char[len+1]; strcpy(data,s); } int main() { MyString a("C++Programing"); MyString b(a); return 0; } 在运行上面的程序时出错,出错的原因是A.构造函数的实参不允许是本类的对象B.没有定义实现深层复制(深拷贝)的拷贝构造函数C.构造对象a时实参与形参类型不符D.系统不能生成缺省的拷贝构造函数
考题
有如下的程序: #include<cstring.h) #ingclude<iostream.h) using namespace std; Class MyString {public: MyString(const char*s); ~MyString(){delete[]data;} protected: unsigned len; char*data;}; MyString::MyString(const char*S) {lA.构造函数的实参不允许是本类的对象B.没有定义实现深层复制(深拷贝)的复制构造函数C.构造对象a时实参与形参类型不符D.系统不能生成默认的复制构造函数
考题
如果你试图编译下面的代码会发生什么事? Class MyString extends String{ }
A.代码编译成功B.代码不能编译,因为没有定义一个main()方法C.代码不能编译,因为String是abstract类型的D.代码不能编译,因为String是final类型的
考题
Const mystring=“hello”的含义是( )。A.在VBScript中,把变量mystring赋值为helloB.在VBScript中,把常量mystring的值定为helloC.在Java中,把变量mystring赋值为helloD.在Java中,把变量mystring赋值为hello
考题
在某类的公共部分有声明string operator++( );和string operator++(int);则说明A.string operator++( );是前置自增运算符声明B.string( )perator++( );是后置自增运算符声明C.string operator++(int);是前置自增运算符声明D.两条语句无区别
考题
有如下程序:includeincludeusing namespace std;class MyString{public:My
有如下程序: #include<cstring> #include<iostream> using namespace std; class MyString{ public: MyString(const char * s); ~MyString( ){delete[ ]data;} protected: unsigned len; char * data; }; MyString::MyString(const char * s){ len=strlen(s); data=new char[1en+1]; strcpy(data,s); } int main( ){ MyString a("C++Progreanfing"); MyString b(A) ; return 0; } 在运行上面的程序时出错,错误的原因是A.构造函数的实参不允许是本类的对象B.没有定义实现深层复制(深复制)的复制构造函数C.构造对象a时实参与形参类型不符D.系统不能生成缺失的复制构造函数
考题
有如下的程序:include include using namespace std;class MyString{p
有如下的程序: #include <cstring.h> #include <iostream.h> using namespace std; class MyString { public: MyString(const char*s); ~MyString () {delete [] data;} protected: unsigned len; char*data; }; MyString::MyString(const char *s) { len=strlen (s); data=new char[len+1]; strcpy (data,s); } int main () { MyString a("C++ Programing"); MyString b(a); return 0; } 在运行上面的程序时出错,出错的原因是A.构造函数的实参不允许是本类的对象B.没有定义实现深层复制(深拷贝)的复制构造函数C.构造对象a时实参与形参类型不符D.系统不能生成默认的复制构造函数
考题
以下SQL 99语句描述的是(59)。CREATE TYPE Employee(name String,ssn integer);CREATE TYPE ManagerUNDER Employee(degree String,dept String);A.关联关系B.嵌套关系C.继承类型D.聚集关系
考题
下列语句中正确的是A.char*myString="Hello-World!";B.char myString="Hello-World!";C.char myString[11]=”Hello-World!”;D.char nlyString[12]="Hello-World!";
考题
以下SQL99语句描述的是(26)。 CREATETYPE Employee( Name String, ssn integer); CREATE TYPE Manager UNDER Employee( Degree String, Dept String);A.关联关系B.嵌套关系C.继承类型D.聚集关系
考题
String、StingBuffer都是( )类,都不能被继承。A.staticB.abstractC.finalSX
String、StingBuffer都是( )类,都不能被继承。A.staticB.abstractC.finalD.private
考题
下面这段代码中,变量myInteger的结果是()。 Dim myString As String="ABCDE" Dim myInteger As Integer myInteger=myString.IndexOf("D")A、0B、1C、2D、3E、4
考题
下面这段代码中,变量myChar的结果是()。 Dim myString As String = "ABCDE" Dim myChar As Char myChar = myString.Chars(3)A、BB、CC、DD、E
考题
下列关于容器集合类的说法正确的是()。A、LinkedList继承自ListB、AbstractSet继承自SetC、HashSet继承自AbstractSeD、WeakMap继承自HashMap
考题
单选题下面这段代码中,变量myInteger的结果是()。 Dim myString As String="ABCDE" Dim myInteger As Integer myInteger=myString.IndexOf("D")A
0B
1C
2D
3E
4
考题
单选题下列语句中,正确的是( )。A
char*myString=“Hello-World!”;B
char myString=“Hello-World!”;C
char myString[11]=“Hello-World!”;D
char myString[12]=“Hello-World!”;
考题
单选题下面这段代码中,变量myChar的结果是()。 Dim myString As String = "ABCDE" Dim myChar As Char myChar = myString.Chars(3)A
BB
CC
DD
E
考题
判断题JSP可以继承String类。A
对B
错
热门标签
最新试卷