Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

static class

Thread view: 
raghu - 18 Dec 2005 16:40 GMT
what is meant by static class?
how do u define it?
where will we use it?

thanks alot in advance
Chris Smith - 18 Dec 2005 16:55 GMT
> what is meant by static class?
> how do u define it?
> where will we use it?

There are two commonly used definitions of that term.  Because there are
two, it's worth being very explicit in communication about which you
mean, if it's not obvious from context.

The first meaning is a class that is merely a collection of static
things.  That is, you aren't supposed to create an object of that class.  
You are just supposed to call its static methods.  An example is
java.lang.Math.  This has been called a "static class" by many people
since at least Java 1.0.2, the initial release more than ten years ago.  
I don't know if the term is used in any other languages, but I hadn't
heard it until Java.

In Java 1.1, the situation was confused by adding a second meaning.  
Java 1.1 provides the option of declaring nested classes, and those can
be declared static, meaning that they aren't inner classes and therefore
don't contain a reference to an object of the outer class.  So it makes
sense to call these "static".  To avoid confusion, they are often called
"static nested classes" instead of just "static classes"... but it's
possible that's what your source meant.

Signature

www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation

Luc The Perverse - 18 Dec 2005 20:45 GMT
> what is meant by static class?
> how do u define it?
> where will we use it?

Listen - if you have 15 questions to ask then follow these simple
instructions:

Start a thread with the subject Beginner Questions/Homework Help

Then list all of your questions in a row, in the same post.

This way, if people are uninterested in helping you they can quickly mark
the thread as read.

There are pay tutor sites on the web that I imagine would LOVE to help you
answer these simple questions.

--
LTP

:)
Roedy Green - 19 Dec 2005 01:07 GMT
On Sun, 18 Dec 2005 13:45:29 -0700, "Luc The Perverse"
<sll_noSpamlicious_z_XXX_m@cc.usu.edu> wrote, quoted or indirectly
quoted someone who said :

>Listen - if you have 15 questions to ask then follow these simple
>instructions:

I disagree. I think each separate question deserves a separate thread.
You should not muddle together unrelated things in the same thread. It
makes the discussion harder to find later.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Roedy Green - 19 Dec 2005 01:06 GMT
>what is meant by static class?
>how do u define it?
>where will we use it?

see http://mindprod.com/jgloss/nestedclasses.html
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.