State the significance of public and private modifiers, JAVA Programming

Assignment Help:

State the significance of public, private, protected, default modifiers both singly and in combination and state the effect of package relationships on declared items qualified by these modifiers.

Public: Public class is visible in other packages, field is visible everywhere (class must be public too)

Private : Private variables or methods might be used only by an instance of the similar class that declares the variable or method, A private feature might only be accessed by the class that owns the feature.

Protected: Is available to all classes in the similar package and also available to all subclasses of the class that owns the protected feature. This access is given even to subclasses that reside in a dissimilar package from the class that owns the protected feature.

What you get by default i.e. without any access modifier (ie, public private or protected). It means that it is visible to all within an exact package.

 


Related Discussions:- State the significance of public and private modifiers

Explain what is naming applets in java applets, Explain what is Naming Appl...

Explain what is Naming Applets in java applets? You can give an applet a name by using the NAME attribute of the APPLET element. This allows communication between different app

Java , what is thread synchronization

what is thread synchronization

Explain how many ways businesses monitor their employees, Explain how many ...

Explain how many ways businesses monitor their employees? • Systems are available which monitor almost every key stroke that an employee forms on a computer. • Systems are avai

Program to calculates the number of unique shapes, 1. Write the code for th...

1. Write the code for the method that calculates the number of unique shapes for a binary search tree with n nodes. Use the formula  where b n is the number of possible sh

What is dispatchaction, The DispatchAction class is used to group related a...

The DispatchAction class is used to group related actions into single class. Using this class, you can have a method for every logical action compared than a one executes method. T

Program to abstract syntax tree constructed, Please submit your answers    ...

Please submit your answers     In this homework, we are going to generate Java Virtual Machine codes by processing the abstract syntax tree constructed from the parsing process

Instance variables and arrays, For an assignment I need to write an array p...

For an assignment I need to write an array program to go along with an instance variable. I keep getting the no main class error when I run my program.

Explain javamail, Normal 0 false false false EN-IN X-...

Normal 0 false false false EN-IN X-NONE X-NONE MicrosoftInternetExplorer4

Differentiate between primitives and objects, Differentiate between Primiti...

Differentiate between Primitives and Objects Everything in Java is an "Object", as every class by default inherits from class "Object", except a few primitive data t

Applet, how to create a face with nose using applet

how to create a face with nose using applet

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