I tried using java.awt.Graphics for the first time and came across so many confusions.
Graphics gp = new Graphics();
and the compiler threw an error saying an abstract class cannot be instantiated. I had a look at the oracle java documentation and then tried the following:
import java.awt.Graphics;
public abstract class GUI extends Graphics{
public void painter(){
GUI gp = new GUI();
gp.drawString("Hello People!",2,10);
}
}
Still it shows the same error: GUI is abstract;cannot be instantiated
I do not have any idea about the abstract classes and implementation. However, I managed to get some knowledge in the Oracle's documentation. But still I'm confused, please someone help me. Thank you so much!!!!
I also tried removing abstract scope of GUI, but the compiler again threw another error saying: GUI does not override the abstract method
dispose();`in java.awt.Graphics();