Posts

Showing posts from November, 2015

Access Modifiers in JAVA

Access Modifiers are used to Control the access and to maintain the confidentiality of the classes and it's members. There are two access levels in JAVA where access modifiers are applicable. namely, class level member level In Java we have four access modifiers. namely, Public Protected Default Private Class Level Only Public and Default access modifiers are applicable for class level declaration. public This can be access from anywhere either from the inside of the package or the outside of the package . If a public class needed to be accessed from the outside of the package, it is a must to import that package which contains that class. package test; import access_modifiers . PublicClass ; TestPublic{     PublicClass pc = new PublicClass(); } package access_modifiers ; public class PublicClass { } We are not using the import statement when accessing a class inside the same package. default There is no keyword for the default acces

Keyword 'final' in JAVA

The general meaning of the word 'final is given below as in the google definitions. final ˈfʌɪn(ə)l/ adjective adjective:  final 1 . coming at the end of a series. "the final version of the report was presented" synonyms: last , closing, concluding, finishing,  end ,  ending , terminating,  terminal ,culminating,  ultimate ,  eventual ,  endmost "their final year of study" antonyms: first ,  initial reached or designed to be reached as the outcome of a process or a series of actions and events. "the final cost will easily run into six figures" allowing no further doubt or dispute. "the decision of the judging panel is final" synonyms: irrevocable ,  unalterable ,  absolute ,  conclusive ,  irrefutable , incontrovertible ,  indisputable ,  unappealable ,  unchallengeable , binding ;  More antonyms: provisional It's also same in JAVA. We use the key