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

Answers were Sorted based on User's Feedback



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

Answer / ravikiran(aptech mumbai)

public class is the one whose memebers can get an access to
all the classes in the same package and out of the package

Is This Answer Correct ?    14 Yes 0 No

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

Answer / 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

More Core Java Interview Questions

what is servlet filter?

2 Answers  


how to handle http request in struts

2 Answers   Polaris,


Explain when we should make an instance variable private.

0 Answers  


How does system arraycopy work in java?

0 Answers  


When try and catch block is used ?

6 Answers  






What do you mean by Function Overloading in java?

0 Answers   Impetus,


What is passing value java?

0 Answers  


Enlist few advantages of inheritance?

0 Answers  


What is a module function?

0 Answers  


What are variable names?

0 Answers  


what is a static block?

4 Answers  


What is meant by class loader and how many types are there?

2 Answers   Apple,


Categories