Results 1 to 3 of 3
- 11-04-2012, 01:28 PM #1
Member
- Join Date
- Aug 2012
- Posts
- 10
- Rep Power
- 0
- 11-04-2012, 01:47 PM #2
Senior Member
- Join Date
- Aug 2009
- Posts
- 294
- Rep Power
- 0
Re: Can the class be instantiated with the static keyword ?
No.
That wouldn't be a class clause. It more resembles a method.
A method that is static, returns a "class" object and is called c1.
- 11-04-2012, 01:57 PM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,406
- Blog Entries
- 7
- Rep Power
- 17
Re: Can the class be instantiated with the static keyword ?
A static class has to be a class nested in the scope of another class (otherwise the 'static' qualification is forbidden). You don't need an object of the enclosing class to create an object of the (static) nested class; if the nested class weren't static you would need an object of the outer class to create an oject of the nested (inner) class.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
Similar Threads
-
Using variables from a non-instantiated class
By Skater901 in forum New To JavaReplies: 4Last Post: 05-19-2012, 12:43 PM -
Class can't be instantiated.
By 3maksim in forum Java AppletsReplies: 12Last Post: 01-25-2012, 05:23 AM -
static keyword
By lala in forum New To JavaReplies: 19Last Post: 01-11-2011, 08:06 PM -
class is abstract; cannot be instantiated
By Jamison5213 in forum New To JavaReplies: 3Last Post: 04-25-2010, 09:16 PM -
use of static keyword
By venkatallu in forum New To JavaReplies: 2Last Post: 06-25-2009, 07:53 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks