0
import java.awt.*;   

class FirstFrame extends Frame {

    FirstFrame() {
        Button b = new Button("ok");
        b.setBounds(30, 100, 80, 30);
        add(b);
        setSize(400, 400);
        setLayout(null);
        setVisible(true);
    }

    public static void main(String args[]) {

        FirstFrame f = new FirstFrame();
    }
}
MadProgrammer
  • 343,457
  • 22
  • 230
  • 366
user2601676
  • 1
  • 1
  • 4

2 Answers2

0

You may have accidentally created any other .java file named "Frame" in your present directory. If you have any such .java file then rename it to other name

P.Sharan
  • 29
  • 4
0

It's simply means that you have created a file with name "Frame.java", just change it's name and your run your program. Please remove or make sure it appears in the correct subdirectory of the sourcepath. As your program cannot access the actual Java.awt.Frame class, as you have created some other Frame class, so your program is unable to differentiate because of ambiguous statement. Stay Blessed!