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

What does it mean that a method or field is static, What does it mean that ...

What does it mean that a method or field is "static"? Static variables and methods are instantiated only once per class. In other words they are class variables, not example va

Clean up for java programs, You have recently joined a games company. The S...

You have recently joined a games company. The SQA manager has given you the task of improving the code quality of simple games. This is a standard task which the SQA manager gives

XML File Homework, I need help on java homework. Is it possible to know the...

I need help on java homework. Is it possible to know the shortest possible time to get the solution before giving my commitment

Android app for evaluating of distance, Android app for evaluating of dista...

Android app for evaluating of distance Project Description: The request is to prepare an app for Android. The application needs to run on tablet (7 "or larger) and the layout

Create a program for student database, You are required to write a program ...

You are required to write a program that is going to be used to store the student details of a particular school.  This school caters for students aged between 5 years to 15 years.

Coding, code for error correction and detection using even odd parity

code for error correction and detection using even odd parity

Please answer this, Assignment Help >> JAVA Programming Learning Outcomes:...

Assignment Help >> JAVA Programming Learning Outcomes: 1. Use different program control statements in a programming language 2. Demonstrate the use of arrays with a programming

Explain the use and purpose of java adapter classes, Question: (a) Exp...

Question: (a) Explain the event handling mechanism using a 'JComboBox' as example. Your answer must clearly indicate the event source, event object and event listener. Also

Myfirstprogram in java, The purpose of this assignment is to help you learn...

The purpose of this assignment is to help you learn the Java environment and practice I/O instructions, assignment, and simple arithmetic operators. Teams: The assignment can

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