Question
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.

Answers

public : Public class is visible in other packages, field is visible everywhere (class must be public too) private : Private variables or methods may be used only by an instance of the same class that declares the variable or method, A private feature may only be accessed by the class that owns the feature. protected : Is available to all classes in the same package and also available to all subclasses of the class that owns the protected feature.This access is provided even to subclasses that reside in a different package from the class that owns the protected feature. default :What you get by default ie, without any access modifier (ie, public private or protected).It means that it is visible to all within a particular package.   Your Comment




More Software,Java Questions..
What is the inputsplit in map reduce software?

Can variables be used in Java without initialization?

What is the difference between java bean and enterprise java bean?

What is software configuration management?

How does the java database connectivity (jdbc) work?

What are the advantages of threads in java?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

What is object cloning in Java?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?



Search
Can you Answer!!
  • Q Which actress was the Connecticut state golf champ at age 16
  • Q In Arthurian and Welsh Romance legendary stories, who was the faithful wife of Geraint/Gereint?
  • Q What is the purpose of Assembly keyword in VB.NET
  • Q What is the capital of New Zealand?
  • Q Strabismus is the correct name for what condition
  • Q With only 16 KM length, which is the smallest river of, Kerala?
  • Q What are the parameters correlated in Freundlich adsorption isotherm?
  • Q Using the fewest names of the members of this family, identify the tree family which includes among its members the: Pignut, scarit, mockernut, bitternut, black and shagbark. Name the tree family.
  • Q The Florence Nightingale School of Nursing was founded in 1860 at which London institution?
  • Q What is the use of tables option in exp command ?
  • Q Nagios administrator is adding 100+ clients in monitoring but he don't want to add every .cfg file entry in nagios.cfg file he want to enable a directory path. How can he configure directory for all configuration files?