Answer Posted / shekhar suchak
private:it can be access within the block or we can aslo say that within the class.
public:"every where,any where" just one line ans.
protected:it can be access within package and outside of package.but there should be inheritense.
default:it will be access within the package.
class can not be private and protected.its only default and public.we dont have to mention 'default' keywords it always be there,but invisible.
Thanks & Regards
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are the different ways of implementing thread? Which one is more advantageous?
What is the importance of main method in Java?
Is string is a data type in java?
How does hashset work in java?
How do you reverse sort a list in java?
Differentiate between a constructor and a method? Can we mark constructors final?
Difference between ‘>>’ and ‘>>>’ operators in java?
What is string builder in java?
What is a blocking method in Java?
What is singletonlist in java?
What is initial size of arraylist in java?
Make a data structure and implement an algorithm to print all the files in a directory. (The root directory can have sub-directories too.)
Can java cast null?
What is difference between this and super keyword?
What is a conditional equation?