What is the difference between a public and a non-public
class?

Answer Posted / javachi

public class is a class that can be accessed from anywhere in the package and outside the package, this public means access globaly.
there is no such non-public class in java. so we can consider private, protected, friendly classes as a non-public classes.

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many types of assembly languages are there?

623


Can an unreferenced object be referenced again?

835


What is string substring?

663


What is a control variable example?

625


What are the two ways of implementing multi-threading in java?

960






Can It is possible to synchronize the constructor of a Java Class?

690


Explain the public class modifier?

605


What do you mean by mnemonics?

651


What is java english?

580


Explain the reason behind ending a program with a system.exit(0)?

684


Explain the difference between call by refrence and call by value?

663


Can we create a constructor in abstract class?

659


Can an interface be defined inside a class?

603


Is map ordered in java?

616


What are 3 data types?

635