Friday, May 18, 2018

Technical Tip #08 - Technical Tip of the day....by JavaExpertHelp – www.JavaByKiran.com

T8: Knowledge Tip Of The Day....
Access Modifiers in Java
access modifiers are helps to restrict the scope of a class, constructor , variable , method or data member.
Four types of access modifiers
1. Default – No keyword required : When no access modifier is specified for a class , method or data member – It is said to be having the default access modifier by default.
2. Private : The methods or data members declared as private are accessible only within the class in which they are declared.
Any other class of same package will not be able to access these members.
Classes or interface can not be declared as private.
3. Protected : The methods or data members declared as protected are accessible within same package or sub classes in different package.
4. Public : The public access modifier has the widest scope among all other access modifiers.

Note:
 If other programmers use your class, try to use the most restrictive access level that makes sense for a particular member. Use private always.
 Avoid public fields except for constants.



Regards,
javabykiranhr1@gmail.com
#Java #Learn #Upgrade #Training #Classes #OnlineLecture #OnlineVideos #Pune
#Call Now to book your seat to JOIN Java Training @ 7219474925, eMail @ javabykiranhr1@gmail.com
#Visit us @ www.JavaByKiran.com
#Java #J2EE
#Core +#Advance + #Struts +#Hibernate + #Spring + #REST + #OCJP + #OCWCD + #Maven + #Junit + #Jquery #Ajax + #XML
#Spring Boot + CI and many more ..
#Selenium
#Complete #Java + #Selenium + #TestNg + #Jenkin + #Webdriver + #Cucumber +#Maven + #DataProvider + #Keyword + #Hybrid + #POM End to End integration #Jenkin #Maven #Testng and many more ..
#JavabyKiran #Expert #Training #BestInstitute #Java #Python #Selenium #Freshers #Professionals #IT #Software #Career #Interview #Jobs#Jobopening  #BestTrainingInstituteinPune #ITCourses  #OnlineVideo  #Pune


No comments:

Post a Comment