What are different types of access modifiers?
Answers were Sorted based on User's Feedback
Answer / venki
Private : It can access with in the class only
public :It can Access Any where
proteced:It can access with in the package and sub class of
the package also
default:it access with in the package only.
| Is This Answer Correct ? | 13 Yes | 3 No |
Answer / 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 |
Answer / nani
Private : It can access with in the class only
public :It can Access Any where in java program
proteced:It can access with in the package and sub class of
the package also
default:it access with in the java program.
| Is This Answer Correct ? | 0 Yes | 2 No |
What is mysql driver class name?
Can we overload the constructors?
What are methods of a class?
What is the structure of java?
How many bits are used to represent unicode, ascii, utf-16, and utf-8 characters?
What are some characteristics of interference class?
What is parseint?
What is the statements?
What do the thread?class methods run() and start() do?
Can inner class final?
What is entry in java?
Why does the integer quotient -0/3 yield 0, but the double quotient -0.0/3.0 yields – 0.0?