What are access specifiers available in java, JAVA Programming

Assignment Help:

What are Access Specifiers available in Java?

Java has four access specifiers, which are enlisted below:

Public: public methods, classes and fields can be accessed by every class.

Protected: protected methods and fields can be accessed only within the same class to which the fields and methods belong.

Default (no specifier): when we don't set access to specific level, then such a method, class or field would be accessible from inside the same package to which the method, class or field belongs.

Private: private methods and fields can only be accessed within the same class to which methods and fields belong. Private methods and fields aren't inherited by subclasses.

 


Related Discussions:- What are access specifiers available in java

Explain overriding methods and the solution, Explain Overriding Methods: Th...

Explain Overriding Methods: The Solution The object oriented solution to this problem is to describe a new class, call it SlowCar, that inherits from Car and imposes the additi

Which is better to store data as attributes or as elements? , A question ri...

A question rising in the mind of XML/DTD designers is whether to model and encode retain information using an attribute, or alternatively, using an element. 1. Using  an  elemen

Java script, var temp =14; var y = 2; temp document.write(temp);

var temp =14; var y = 2; temp document.write(temp);

Action listener and event listener, differende between action listener and ...

differende between action listener and event listener

Get info from website using javascript, Get info from website using javascr...

Get info from website using javascript Project Description: I need to extract the text from all the available (red, blue) seats of all the events on this site without getting

Android, What is basic of android?

What is basic of android?

Develope a simple polling web application, Develop a simple polling (voting...

Develop a simple polling (voting) web application according to the following specifications: Initially a page should be presented to the user where he can enter his/her name

What is an iterator, What is an Iterator? Some of the collection classe...

What is an Iterator? Some of the collection classes give traversal of their contents via a java.util.Iterator interface. This interface permits you to walk through a collection

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd