给出下列的不完整的类代码,则哪个语句可以被加到横线处? ( ) class Person{ String name,department; int age; public Person(String n){name=n;} public Person(String n,int s){name=n; age=a;} public Person(String n,String d,int a){ department=d;______ } }
A.Person(n,a);
B.this(Person(n,a));
C.this(n,s);
D.this(name,age);
第1题:
给出下列的不完整的类代码,则下列的( )语句可以加到横线处。 class Person{ String name,department; int age public Person(String n){name=n;} public Person(String n,int a){name=n;age=a;} pubilc Person(String n,String d,int a) { _______________ department=d; } }
A.Person(n,a);
B.this(Person(n,a));
C.this(n,a);
D.this(name,age);
第2题:
给出下列的不完整的类代码,则下列的哪个语句可以加到横线处? 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 ) { _____________ department = d; } }
A.Person(n,a);
B.this(Person(n,a) );
C.this(n,a);
D.this(name,age);
第3题:
若有如下定义,则下面能输出字母M的语句是()。struct person{ char name[9]; int age; }; struct person class[10]={"John",17,"paul",19,"Mary",18,"Adam",16};
A.printf("%cn",class[3].name);
B.printf("%cn",class[3].name[1]);
C.printf("%cn",class[2].name[1]);
D.printf("%cn",class[2].name[0]);
第4题:
给出下面不完整的类代码,则横线处的语句应该为( )。 class Person { String name,department; int age; public Person (Strings) {name=s;} public Person (String s,int
A.{name=s;age=a;} public Person (String n,String d,intA){ __________ department=d; } }A)Person (n,A);
B.this (Person(n,A));
C.this(n,A);
D.this(name,age);
第5题:
10、通过下面的代码片段来回答问题。 _________ User { var uuid:UUID var name:String init(uuid: UUID, name:String) { self.uuid = uuid self.name = name } } 下划线处可以填写哪些关键词?
A.protocol
B.struct
C.enum
D.class