重要提示: 请勿将账号共享给其他人使用,违者账号将被封禁!
查看《购买须知》>>>
找答案首页 > 全部分类 > 求职面试
搜题
网友您好, 请在下方输入框内输入要搜索的题目:
搜题
题目内容 (请给出正确答案)
[主观题]

以下程序的输出结果为 。 class Person { public Person() { System.out.println("Person"); } }

以下程序的输出结果为 。  class Person { public Person() { System.out.println("Person"); } } class Student extends Person { public Student() { System.out.println("Student"); } } class CollegeStudent extends Student { public CollegeStudent() { System.out.println("CollegeStudent"); } } public class Test { public static void main(String[] args) { CollegeStudent cs = new CollegeStudent(); } }

暂无答案
更多“以下程序的输出结果为 。 class Person { public Person() { System.out.println("Person"); } }”相关的问题

第1题

以下程序的运行结果是 class Person{ public Person(){ System.out.println(“this is a Person”); } } public class Teacher extends Person{ private String name=”tom”; public Teacher(){ System.out.println(“th..

以下程序的运行结果是 class Person{ public Person(){ System.out.println(“this is a Person”); } } public class Teacher extends Person{ private String name=”tom”; public Teacher(){ System.out.println(“this is a teacher”); super(); } public static void main(String[] args){ Teacher teacher = new Teacher(); System.out.println(this.name); } }

A、this is a Person this is a teacher tom

B、this is a teacher this is a Person tom

C、运行出错

D、编译有两处错误

点击查看答案

第2题

阅读以下程序,给出运行结果。classPerson{Person(){System.out.print("Thisisaperson.&quo
阅读以下程序,给出运行结果。

classPerson{

Person(){

System.out.print("Thisisaperson.");

}

}

publicclassStudentextendsPerson{

Student(){

System.out.print("Thisisastudent");

}

publicstaticvoidmain(String[]args){

Studentstu=newStudent();

}

}

运行结果是:

点击查看答案

第3题

阅读下列的程序 class Person{ static{ System.out.println("static") } Person(){ System.out.p
rintln("构造") } } class Demo{ public static void main(String[] args){ Person p = new Person(); } } 下列关于程序运行结果的描述中,正确的是

A、没有输出结果

B、输出:构造

C、输出:static 构造

D、输出:static

点击查看答案

第4题

请阅读下面的程序代码 Class Person{ void say(){ System.out.println(“hello”); } } class Exam
8、请阅读下面的程序代码 Class Person{ void say(){ System.out.println(“hello”); } } class Example{ public static void main(String[] args){ Person p2 = new Person(); Person p1 = new Person();    p2.say(); p1.say(); p2=null; p2.say(); } } 下列关于程序运行结果的描述中,正确的是()

A、A.输出1个hello

B、B.输出2个hello后会抛出异常

C、C.输出3个hello后会抛出异常

D、D.不会输出hello,直接抛出异常

点击查看答案

第5题

7、阅读下列的程序 class Person{ static{ System.out.println(name); } private static String name = "hello"; } class Demo{ public static void main(String[] args){ Person p = null; } } 下列关于程序运行结果的描述中,正确的是( )

A、A.无结果输出

B、B.输出 null

C、C.输出 hello

D、D.编译失败

点击查看答案

第6题

请看下面的程序段:public class Person{static int arr[] = new int[10];public static void main(String a[]) {System 、out 、println(arr[1]);}}下面说法正确的是()。

A、当编译时会发生错误

B、编译不会发生错误但执行是会发生错误

C、输出结果为0

D、不会输出结果

点击查看答案

第7题

阅读下面的程序: public class Person{ int arr[ ]=Hew int[10]; public static void main(String args[ ]){ System.out.println(arr[1]); } } 正确的说法是______。

A.编译时将产生错误

B.编译时正确,运行时将产生错误

C.输出为0

D.输出为空

点击查看答案

第8题

有程序如下,关于程序的描述哪个是正确的?( ) public class Person{ static int a[] = new int[10]; public static void main(String a[]) { System.out.println(arr[1]); } }

A. 编译将产生错误

B. 编译时正确,但运行时将产生错误

C. 正确,输出0

D. 正确,输出?null

点击查看答案

第9题

【填空题】在(1)~(3)处填上适当的语句,使程序能正常运行。. abstract class Person { public (1) sh
ow(); } class Student extends Person{ public (2) { System.out.println("Student");}} (3) { public void show(){ System.out.println("Teacher");}} public class Demo{ public static void main(String []args){ Person p; p=new Student(); p.show(); p=new Teacher(); p.show(); }}

点击查看答案

第10题

阅读下面的程序,分析代码是否能够编译通过,如果能编译通过,请列出运行的结果。否则请说明编译失败
的原因。 class Person{ Person(){ this.show(10); } public void show(){ int x = 0 ; System.out.println(x++); } public void show(int x){ System.out.println(++x); } } class Demo{ public static void main(String[] args){ new Person(); } }

点击查看答案
下载上学吧APP
客服
TOP
重置密码
账号:
旧密码:
新密码:
确认密码:
确认修改
购买搜题卡查看答案
购买前请仔细阅读《购买须知》
请选择支付方式
微信支付
支付宝支付
选择优惠券
优惠券
请选择
点击支付即表示你同意并接受《服务协议》《购买须知》
立即支付
搜题卡使用说明

1. 搜题次数扣减规则:

功能 扣减规则
基础费
(查看答案)
加收费
(AI功能)
文字搜题、查看答案 1/每题 0/每次
语音搜题、查看答案 1/每题 2/每次
单题拍照识别、查看答案 1/每题 2/每次
整页拍照识别、查看答案 1/每题 5/每次

备注:网站、APP、小程序均支持文字搜题、查看答案;语音搜题、单题拍照识别、整页拍照识别仅APP、小程序支持。

2. 使用语音搜索、拍照搜索等AI功能需安装APP(或打开微信小程序)。

3. 搜题卡过期将作废,不支持退款,请在有效期内使用完毕。

请使用微信扫码支付(元)
订单号:
遇到问题请联系在线客服
请不要关闭本页面,支付完成后请点击【支付完成】按钮
遇到问题请联系在线客服
恭喜您,购买搜题卡成功 系统为您生成的账号密码如下:
重要提示: 请勿将账号共享给其他人使用,违者账号将被封禁。
发送账号到微信 保存账号查看答案
怕账号密码记不住?建议关注微信公众号绑定微信,开通微信扫码登录功能
警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

- 微信扫码关注上学吧 -
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反上学吧购买须知被冻结。您可在“上学吧”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
- 微信扫码关注上学吧 -
请用微信扫码测试
选择优惠券
确认选择
谢谢您的反馈

您认为本题答案有误,我们将认真、仔细核查,如果您知道正确答案,欢迎您来纠错

上学吧找答案