import javax.swing.*;
public class InheritanceSample
{
public static String name;
public static int count;
public static void main (String args[])
{
System.out.print('\f');
name = JOptionPane.showInputDialog("Enter Name:");
count = Integer.parseInt(JOptionPane.showInputDialog("Enter count:"));
InheritanceClass ic = new InheritanceClass();
ic.display();
}
}
====================================================================
//put this in a separate class
import javax.swing.*;
public class InheritanceClass //extends InheritanceSample
{
public void display()
{
int count = count + 1;
System.out.println("Name:" + name);
System.out.println("Count:" + count);
}
}