没有合适的资源?快使用搜索试试~ 我知道了~
JAVA的面向对象编程(2).pdf
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 66 浏览量
2021-10-04
18:39:58
上传
评论
收藏 65KB PDF 举报
温馨提示
试读
30页
JAVA的面向对象编程(2).pdf
资源推荐
资源详情
资源评论
JAVA --------
11.28
EVERYTHING IS OBJECT
OOP
class Student{
}
New
null
Public int/void addNumber( ) throw Excepion {}
public int addNumber(int a,int b){
}
int a,int b
public
Student s=new Student()
Student Student Student()
()
S
Student s s
S Student
public student(string name,int a){
}
public student(int a,string name){
}
static void changename(studentstu){stu.setName LUCY
overloading overriding
JAVA overriding overloading
Overloading
overloading
overloading
overloading
public void teach(){};
public void teach(int a){};
public void teach(String a){}
Overloading
Byteshortfloat intlongdouble
this
student(){};
student(string n){
this();// student()
}
student(int a) this(int a)
this this
This
Public void printNum(){
Int number=40
System.out.println(this.number);
}
This.number
this.number (this) number
private
Public
Private
private set get
this
this
11.29
SuperClass SonClass
Class Son extends Father{
}
JAVA
JAVA JAVA
overriding
overloading
public private
private
default
Protected +
Public
Super()
Super() this
This()
super()
Animal a=new Dog()
Dog d=(Dog)a
1
2
Animal a=new Dog() a Animal dog
Dog d=(Dog)a d a d Dog() d
a d
3
instanceof
a instanceof Animal;( )
a Animal
a Animal true false
a instanceof Animal True
a instanceof Dog True
instanceof
Instanceof
Animal a=new Animal()
Dog d=Dog()a;
Animal a=new Dog()
Animal a=getAnimal()
Public static Animal.getAnimal;
Return new Dog()
Overloading
shape circle rect
Shape zhouchang() area()
squ rect rect cha()
private public A B
11.29 Module6
Module6-7
static:
Static int data data
Int data
static int data;
m1.data=0;
m1.data++ 1, m2.data 1
Static
.
剩余29页未读,继续阅读
资源评论
maodi_lzc
- 粉丝: 1
- 资源: 4万+
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功