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 is the difference between keyword and identifier?
Which sorting algorithm is in place?
How will you serialize a singleton class without violating singleton pattern?
how to prepare for IT Officers Interview in Banks
Can a hashset contain duplicates java?
What are the different types of methodologies?
What is the difference between a factory and abstract factory pattern?
I want to print “hello” even before main is executed. How will you acheive that?
Are arrays immutable in java?
What do you mean by ordered and sorted in collections in java?
What is null object in java?
Why is stringbuffer thread safe?
Why can't you declare a class as protected?
what is the difference between the methods sleep() and wait()? : Java thread
Why string is immutable with example?