What is public/private protected in java?



What is public/private protected in java?..

Answer / Hitesh Pandey

In Java, access modifiers include: "public" (can be accessed from any class or package), "protected" (can be accessed within the same package and subclasses of other packages), and "private" (can only be accessed within the same class).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

Why does java have two ways to create child threads?

1 Answers  


Explain JMS in detail.

1 Answers   Amdocs,


What is the size of integer?

1 Answers  


Explain about GridBag Layout?

1 Answers  


What is the importance of main method in Java?

1 Answers  


What is default specifier ??? Use of default specifier ???

4 Answers   Cognizant, Syntel,


How do you write a conditional statement?

1 Answers  


What is internal variable?

1 Answers  


What do you mean by default constructor in java?

1 Answers  


they asked class A{} class B{} class c{} all the three class saved as a single file,there is no main method in the file and anothe class M.java class m { psvm(String args[]) { // here the parent class can access } }

2 Answers   DNS, IPSR Solutions,


What is multithreading in java?

1 Answers  


How do you differentiate abstract class from interface?

1 Answers  


Categories