Consider i have an abstract class with a non-abstract method in it. i tried creating reference type object and access that non-abstract method.. it gives me a compilation error. The following program demonstrates it.

```
abstract class A
{
    public void print()
    {
        System.out.println("this is the print method");
    }
}

class test
{
    public static void main(String args[])
    {
        A ob;
        ob.print();
    }
}

```

then this is the output i am getting, 

> 
> Variable ob might not have been initialized 
> 
> 
> 

If i assume the above as true, then why is it allowing the same in the following program. In the following Applet, i use the `paint()` method as an entry point. So, here i create a reference type object of predefined class `Graphics`(an abstract class), and try accessing the `drawString()` method of it, then no compilation error.. like this-->

```
import java.applet.*;
import java.awt.*;

public class apptest extends Applet
{
    public void paint(Graphics g)// Graphics is an abstract class
    {
        String s="this is an applet";
        g.drawString(s,20,20);
    }
}

```

How is this Applet allowing me to do the same ?