What is the difference between a public and a non-public
class?
Answers were Sorted based on User's Feedback
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 |
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 |
How many times finalize method will be invoked? Who invokes finalize() method in java?
Is java platform independent?
What is hash in java?
What is gui programming?
Explain heap sort?
What is the constructor?
What is the use of math abs in java?
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()); } }
How to access a variable if it is declared as private?
Is vector ordered in java?
What are wrapper classes in java?
Does it matter in what order catch statements for filenotfoundexception and ioexception are written?