Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Interface Fields

 
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the reason of having fields as static and final in interfaces?
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
because interface can not have implementation
 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

SCJP 1.4


Again Naresh Chaurasia , you are supposedly already certified therefore you shouldn't be asking basic questions like these that were part of your preparation for the SCJP exam in the first place. I Also noticed in another thread that you asked another basic question regarding checked/unchecked exception, these make me wonder how did you become SCJP and what did you use as a study material if any.
 
Sheriff
Posts: 6914
1314
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mo Jay wrote:

SCJP 1.4


Again Naresh Chaurasia , you are supposedly already certified therefore you shouldn't be asking basic questions like these that were part of your preparation for the SCJP exam in the first place.



Cooldown I think he need to upgrade his certification to the latest version, and might need to focus on some topics like this. Anyway, anyone can ask any SCJP-related question here.

Devaka.
 
Ranch Hand
Posts: 449
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Naresh Chaurasia wrote:What is the reason of having fields as static and final in interfaces?




Also remember, interface serves as a type which means the class that implement an interface say something about what a client can do with instances of the class, which become inappropriate when you use interface only for defining constants.

 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Muhammad Ali Khojaye wrote:
interface serves as a type which means the class that implement an interface say something about what a client can do with instances of the class, which become inappropriate when you use interface only for defining constants.



Exactly . use final class to define the constants.giving a private constructor makes sense
 
This one time, at bandcamp, I had relations with a tiny ad.
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic