• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

final var, static modifier, some qns

 
Ranch Hand
Posts: 485
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
i learnt in k&b that the interface should declare public[b] to avoid the default mehod access.
the methods are implicitly public and abstract i didn't get what k&b is trying to say.



The static modifier can't be applied to class but it can apply to inner class which is top level nested class. can i know why only top-level-nested class is allowed to have static modifier.then if a class is static what about its method and variables effect on this modifier.


can i know some details about transient and volatile esp where it can and can't be used.



The final variables wont get any default values.user need to give the value explicitly that too before the constructor finishes
this is what i grasped from k&B i tried but i getting error.

 
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi paramesh

In ur code avoid instead of giving constructor u have given method

void s()
{
this.a=3;
}

just remove void from that

Then urs expected answer is there
 
Anything worth doing well is worth doing poorly first. Just look at this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic