![]()
//
// final class People{
//
//}
////通过final声明的类不能被继承
//
//
//
//class Student extends People{Í
//
//}
//
//
//public class FinalDemo01 {
//
// public static void main(String[] args) {
// // TODO Auto-generated method stub
//
// }
//
//}
//class People {
// public final void tell(){
//
// }//final 方法不能被重写
//}
//class Student extends People{Í
//
//@Override
//public void tell() {
// // TODO Auto-generated method stub
//// super.tell();
//
//}
//}
//
//public class FinalDemo01 {
//
// public static void main(String[] args) {
// // TODO Auto-generated method stub
//
// }
//
//}
class People {
public void tell(){
}
}
class Student extends People{
}
public class FinalDemo01 {
public static void main(String[] args) {
// TODO Auto-generated method stub
final String Name ="hhhhh";
// name = "343434";//用finali 修饰的属性是常量 不能被修改 名称要大些
System.out.println(Name);
}
}