下列代码的输出结果是( )。
class parent
{
void printme()
{
System.out.println("parent");
}
}
class child extends parent
{
void printme()
{
System. out.println("child");
}
void printall()
{
super, printme();
this.printme();
printme();
}
}
public class test
{
public static void main(String args[])
{
child myc=new child();
myc.printall();
}
}
A.import java.awt.*;
B.import java.applet.applet;
C.import java.io.*;
D.import java, awt.graphics;
第1题:
11、下面代码的输出结果是x = 12.34;print(type(x))
A.<class 'bool'>
B.<class 'complex'>
C.<class 'float'>
D.<class 'int'>
第2题:
下面代码的输出结果是: x = 12.34 print(type(x))
A.<class 'float'>
B.<class 'complex'>
C.<class 'bool'>
D.<class 'int'>
第3题:
下面代码的输出结果是() x = 12.34 print(type(x))
A.<class ‘int’>
B.<class ‘float’>
C.<class ‘bool’>
D.<class ‘complex’>
第4题:
下面代码的输出结果是 x = 12.34 print(type(x))
A.<class 'complex'>
B.<class 'float'>
C.<class 'int'>
D.<class 'bool'>
第5题:
10、变量a表示一个<a>标签,不考虑异常,获取<a>标签爷爷节点名字的代码可能是哪个?
A.soup.a.name
B.a.parent(2).name
C.a.parent.parent.name
D.a.parents.name
第6题:
下面代码的输出结果是x = 12.34;print(type(x))
A.<class 'bool'>
B.<class 'complex'>
C.<class 'float'>
D.<class 'int'>
第7题:
有如下程序:
include <iostream>
using namespace std;
class PARENT
{
public:
PARENT() { cout <<"PARENT"; }
};
class SON : public PARENT
{
public:
SON() {cout << "SON"; }
};
int main()
{
SON son;
PARENT *p;
p = &son;
return 0;
}
执行上面程序的输出是______。
第8题:
A.Object.Method
B.MethodObject
C.Parent.Object.Method
D.Parent.Method
第9题:
有如下程序:
#include
using namespace std;
class PARENT
{
public:
PARENT(){cout<<"PARENT";}
};
class SON:public PARENT
{
public:
SON(){cout<<"SON";}
};
int main()
{
SON son;
PARENT *p;
p = &son;
return 0;
}
执行上面程序的输出是 【 12 】 。