Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

C Books Guide and List
C++ Books Guide and List
Best Java Books

0 votes
3.2k views
asked by (27.1k points) 31 53 112

2 Answers

0 votes
It is an inner class whose name is not written in the outer class and for which only one object is created.
answered by (39.1k points) 10 22 39
0 votes
An inner class which does not contains any name is called as Anonymous inner class.

import java.awt.*;

import java.awt.event.*;

class FrameDemo extends Frame{

FrameDemo(){

this.setVisible(true);

this.setSize(300,300);

this.setTitle(“Anonymous inner class”);

addWindowListener(new WindowAdapter(){

public void windowClosing(WindowEvent ae){

System.exit(0);

                     }

            });

   }

Public static void main(String[] args){

FrameDemo fd = new FrameDemo();

            }

}
answered by (4.8k points) 10 25 32

Related questions

0 votes
1 answer 44 views
44 views asked by sara (24.6k points) 31 55 94
0 votes
1 answer 22 views
22 views asked by keem (13.2k points) 28 44 63
0 votes
1 answer 72 views
0 votes
1 answer 85 views
0 votes
1 answer 30 views
...