1//Program of static variable2classStudent8{3introllno;4String name;5staticString college ="ITS";67Student8(intr,String n){8rollno =r;9name =n;10}11voiddisplay (){System.out.println(rollno+" "+name+" "+college);}1213publicstaticvoidmain(String args[]){14Student8 s1 =newStudent8(...
原文链接:https://www.javatpoint.com/static-keyword-in-java
6 public static void main(String args[]){ 7 TestOuter2.Inner.msg();//no need to create the instance of static nested class 8 } 9 } 1. 2. 3. 4. 5. 6. 7. 8. 9. Output:data is 30 以上是关于Java 中 static 关键字的理解,参考了:http://www.javatpoint.com/...