I'm again here and I like to extend the question I made today about this and super keywords.
Let's take some examples.
Example 1
import java.applet.*;
public class Main extends Applet {
//overrides Applet.init ()
public void init () {
//here I use super keyword without creating an istance of the class Applet
super.init ();
//code here...
}
}
Now let's take an example about this keyword
public class Main {
public void print () {
System.out.println("Hi");
}
public static void main (String [] args) {
//this code instead does not work because I haven't created an istance of the class
this.print();
}
}
So the question is: I can use super without creating an istance of the class, but to use this I have to create an istance of the class, right?