1.this
This points to the current object.
public class helloworld{
String name = "Orange Mulberry";
public void call () {
System.out.println (this.name);
}
}
Several types in 2.java
We know how to define a class, and on that basis, there are subclasses, inner classes.
Class baseclass{//Parent}
Class Newclass extends baseclass{//subclass}
This subclass Newclass inherits all the properties and methods of the parent class, and additionally has its own properties and methods.
public class Wrap {
public class innerclass{
public void Say () {
System.out.println ("Method of the Inner class");
}
}
Program entry
public static void Main (string[] args) {
TODO auto-generated Method Stub
Wrap hi = new Wrap ();//Instance Partial
innerclass Hello = hi.new innerclass (); Instantiate an inner class, note the wording
Hello.say ();
}
}
The above is how to define the inner class and call.
3.
Java Learning Note 04