Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-26-2007, 12:13 PM
Member
 
Join Date: Dec 2007
Posts: 4
$hr!k@nt is on a distinguished road
Final,abstract and static
Why cant constructor be marked as Final????

and also

Why cant static and abstract go together???
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-27-2007, 12:34 AM
CaptainMorgan's Avatar
Moderator
 
Join Date: Dec 2007
Location: NewEngland, US
Posts: 840
CaptainMorgan will become famous soon enoughCaptainMorgan will become famous soon enough
Send a message via AIM to CaptainMorgan
Quote:
Originally Posted by $hr!k@nt View Post
...
Why cant static and abstract go together???
This, coming from the source - Sun itself.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 12-28-2007, 01:19 AM
Member
 
Join Date: Dec 2007
Posts: 12
spoon! is on a distinguished road
final means method cannot be overridden; constructors can't be overridden

abstract means method must be overridden; static methods can't be overridden
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 01-08-2008, 02:07 PM
Member
 
Join Date: Dec 2007
Posts: 4
$hr!k@nt is on a distinguished road
Still confused!!!!!!
I still dont get why constructor cant be declared as final????
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 01-08-2008, 02:37 PM
jelly's Avatar
Member
 
Join Date: Jan 2008
Location: Somerset, UK
Posts: 46
jelly is on a distinguished road
You can't mark constructors as final as there would be no meaning, as spoon says constructors cannot be overridden, final only makes sense when applied to something that _could_ have been overridden but you don't want it to be.
__________________
-- Hope that helps
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 01-09-2008, 06:23 AM
Member
 
Join Date: Dec 2007
Posts: 4
$hr!k@nt is on a distinguished road
Thanks a lot......
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Abstract Class with Static Methods bugger New To Java 7 09-05-2008 01:20 AM
Using static and final attributes – An example (II) JavaForums Java Blogs 0 03-06-2008 12:40 PM
Using static and final attributes – An example (I) JavaForums Java Blogs 0 03-06-2008 12:40 PM
Error: Non-static method append(char) cannot be referenced from a static context paul Advanced Java 1 08-07-2007 06:05 AM
Error: non-static variable height cannot be referenced from a static context at line fernando AWT / Swing 1 08-01-2007 10:25 PM


All times are GMT +3. The time now is 08:57 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org