- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
java复习终极版
1、public class JD1{
int year,month,day;
void set(int y,int m,int d){
year=y; month=m;day=d;}
public static void main(String[] args){
JavaDemo1 d1=new JavaDemo1();
d1.set(2013,12,1);
System.out.println(d1.year);
JavaDemo1 d2=d1;
d2.year=2014;
System.out.println(d1.year);
System.out.println(d2.year);}
}
2013
2014
2014
2、public class JD2{
public static void main(String args[]){
String str=我是Studnent!;
System.out.println(str.length());
System.out.println(str.charAt(1));
System.out.println(str.substring(3));}
}
11
是
tudnent!
3、class A {static int a=3;}
class B extends A {static int a=5;}
class C extends B
{ void show()
{ System.out.println(a=+ a);
System.out.println(A.a=+A.a);
System.out.println(B.a=+B.a);
}}
public class JD3
{ public static void main(String args[])
{C c=new C(); c.show();}
}
a=5
A.a=3
B.a=5
4、class Person{
Person(){
System.out.println(Person中的构造方法);
}
}
class Student extends Person{
Student(){System.out.println(Student中的构造方法);}
}
public class TestDemo01{
public static void main(String args[]){
new Student();
}
}
Person中的构造方法
Student中的构造方法
5、class TestDemo02{
String name;
int age;
static String country=A城;
public TestDemo02(String name,int age){
this.name=name;
this.age=age;
}
public void info(){
System.out.println(姓名:+this.name+,年龄:+this.age+,城市:+country);
}
public static void main(String[] args) {
TestDemo02 p1=new TestDemo02(张三,30);
TestDemo02 p2=new TestDemo02(李四,40);
p1.info();
p1.country=B城;
p2.info();
}
}
姓名:张三,年龄:30,城市:A城
姓名:李四,年龄:40,城市:B城
6、public class TestDemo03 {
public static void main(String[] args){
String str1=hello;
str1=str1+World;
String str2=new String(HelloWrold);
System.out.println(str1.equals(str2));
System.out.println(str1.charAt(3));
}
}
false
l
编程:
第一题:package Jframe;
public class First {
public static void main(String[] args) {
Math math = new Math(40,0);
Math arrray = new Math();
}
}
class Mat
您可能关注的文档
最近下载
- 2025秋统编版(2024)小学道德与法治三年级上册(全册)课时练习及答案(附目录).docx
- (2025秋新版)人教版三年级数学上册《观察物体》PPT课件.pptx VIP
- (鲁班奖)网架专家论证汇报资料.ppt VIP
- 行业资料 - 国家储备林改培技术规程-国家林业局.pdf VIP
- Q960E高强度调质钢焊接工艺研究.pdf VIP
- 2025-2026学年第一学期数学教研组工作计划.doc VIP
- ISO15378-2017药包材对ISO9001的应用.pptx VIP
- 13.1三角形的概念 课件(共24张PPT) 人教版(2025)数学八年级上册(含音频+视频).pptx VIP
- 2025级中职语文教学工作计划5篇.pdf VIP
- 第十章 商品的品名品质数量和包装.ppt VIP
文档评论(0)