No enclosing instance of type ...
public class College {
public class Student{
String sname=null;
String sid=null;
Student(){}
void Setname(String name){
this.sname=name;
}
void nprint(){
System.out.println("sname"+ sname);
}
}
public class Mstudent extends Student{
String mname=null;
void setmname(String name){
this.mname=name;
}
void mprint(){
System.out.println("Mname"+mname);
}
}
public class Ustudent extends Student{
String fname=null;
void setfname (String name){
this.fname=name;
}
void fprint(){
System.out.println("Fname"+ fname);
}
}
public static void main(String[] args ){
College s=new College();
Student s1= new Student();
s1.Setname("zhou");
s1.nprint();
}
}
相关推荐
Java解决No enclosing instance of type PrintListFromTailToHead is accessible问题的两种方案
主要介绍了Java解决No enclosing instance of type PrintListFromTailToHead is accessible问题的两种方案的相关资料,需要的朋友可以参考下
Secrets of the JavaScript Ninja, 2nd Edition
More than ever, the web is a universal platform for all types of applications, and JavaScript is the language of the web. If you’re serious about web development, it’s not enough to be a decent JavaScript coder. You need to be ninja-stealthy, efficient, and ready for anything.
Eclipse Template与模式
Eclipse Template与模式.doc
java开发中嵌套类的详解及实例
主要介绍了 java开发中嵌套类的详解及实例的相关资料,一般把定义内部类的外围类成为包装类(enclosing class)或者外部类,需要的朋友可以参考下
Shell Script
Example:$ echo "Today is date" Can't print message with today's date.$ echo "Today is `date`". It will print today's date as, Today is Tue Jan ....,Can you see that the `date` statement uses back quote?


Java SE
