/    Sign up×
Community /Pin to ProfileBookmark

Anonymous Java classes

This is not really a JavaScript question, but more of a Java question.

I want to know if it is possible to have an anonymous Java class extend something.

For example
addWindowListener(new WindowDestroyer() [B]extends WindowAdapter[/B] {
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});

to post a comment
Java

4 Comments(s)

Copy linkTweet thisAlerts:
@BillyRayAug 26.2004 — This is not really a JavaScript question, but more of a Java question[/quote]

If you are aware that the question you are asking does not belong here then why ask it at all?

Dan
Copy linkTweet thisAlerts:
@zprogauthorAug 26.2004 — Because Java is similar to JavaScript at least in some sense and there are no forums here that are specifically to non-web programming languages.

I just figured that since there are so many sharp guys here, they would know Java and would be able to help me.

In addition, I didn't want to sign up for another forum just to post one topic.
Copy linkTweet thisAlerts:
@rhsundergroundAug 26.2004 — [i]Originally posted by zprog [/i]

[B]In addition, I didn't want to sign up for another forum just to post one topic. [/B][/QUOTE]
it could be worth it, as you might have another problem in the future.

try these:

http://javabotique.com/

http://javaboutique.internet.com/

http://www.devx.com/Java/
Copy linkTweet thisAlerts:
@JPnycAug 26.2004 — You still have to create and define the class in a class file somewhere. You'll get undefined errors otherwise.
×

Success!

Help @zprog spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...