What is protected and friendly?



What is protected and friendly?..

Answer / priyavarzhni

Protected: the method of a class os accessed only when the
other class inherits it.
Friendly: no need for inheritance. we can access the methods

Is This Answer Correct ?    3 Yes 2 No

Post New Answer

More Core Java Interview Questions

State one difference between a template class and class template.

0 Answers   HAL,


What is the difference between numeric and integer?

0 Answers  


What are decalarations?

0 Answers  


Is null a keyword in java?

0 Answers  


Why does java not support pointers?

0 Answers  






What are conditionals and its types?

0 Answers  


Can a constructor have different name than a class name in java?

0 Answers  


Explain all java features with real time examples

0 Answers  


Is it possible to do method overloading and overriding at a time

3 Answers   L&T,


Can we have any code between try and finally blocks?

0 Answers  


Is it possible to write JAVA program without including any of the packages,such as "import java.io.*"; bcoz I instantly wrote a code without "import..." statement and runned the program on command Line & it worked. the code is: class Person { String name; int age; Person(String s,int a) { name = s; age = a; } accept() { System.out.println(name+"Hi!!!!!"); System.out.println(age); } } class Demo { public static void main(Strings args[])throws IOException { String name = args[0]; int age = Integer.parseInt(args[1]); Person p = new Person(name,age); p.accept(); } }

3 Answers  


What is variable and rules of variable?

0 Answers  


Categories