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

How many times finalize method will be invoked? Who invokes finalize() method in java?

0 Answers  


Is java platform independent?

0 Answers  


What is hash in java?

0 Answers  


What is gui programming?

0 Answers  


Explain heap sort?

0 Answers   Flextronics,






What is the constructor?

0 Answers  


What is the use of math abs in java?

0 Answers  


What will be the output of the program? public class Test { public static void main(String args[]) { ArrayList<String> list = new ArrayList<String>(); list.add("2"); list.add("3"); list.add("4"); list.add("5"); System.out.println("size :"+list.size()); for(int i=0;i<list.size();i++) { list.remove(i); } System.out.println("size after:"+list.size()); } }

5 Answers   Rolta,


How to access a variable if it is declared as private?

3 Answers  


Is vector ordered in java?

0 Answers  


What are wrapper classes in java?

0 Answers  


Does it matter in what order catch statements for filenotfoundexception and ioexception are written?

0 Answers  


Categories