最新回答 / 慕村0388519
JDK9及以上版中,建立一个单独的类,无法执行。其中的错误提示:
Error occurred during initialization of boot layer. helloMyJava.class found in top-level directory (unnamed package not allowed in module)12初...
2019-06-19
最赞回答 / 慕盖茨3076686
不是,这叫私有化类中的属性值。封装的目的是不让其他类访直接问类中的信息,但是类中要给出访问的方法(get和set方法),也就是其他类要按照给出的方法去访问,从何实现信息的隐藏。
2019-06-14
https://github.com/HbnKing/Basic/blob/master/JavaBasic/JavaBasic.md
个人学习笔记整理。
个人学习笔记整理。
2019-06-14
public class tree{
float tall;
String type;
String appearance;
void againstWater(){
System.out.println("树可以抗洪");
}
void greening(){
System.out.println("树可以绿化");
}
}
float tall;
String type;
String appearance;
void againstWater(){
System.out.println("树可以抗洪");
}
void greening(){
System.out.println("树可以绿化");
}
}
2019-06-10