What is public, protected, private?

Answer Posted / khadeer.k

public:
public is an access specifier which can be used throughout
the program.
protected:
protected is an access specifier which can be used in the
specified class and its derived class...
private:
private is an access speifier which can be used whithin the
class in which it is declared.

Is This Answer Correct ?    20 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Do you know about multiple inheritance?

637


What do you mean by abstraction?

606


Why multiple inheritance is not allowed?

581


Is this job good for future? can do this job post grduate student?

1688


What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?

2098






What are properties in oop?

605


Get me a number puzzle game-program

1690


What causes polymorphism?

568


c++ program to swap the objects of two different classes

1757


write a program to enter a string like"sunil is a good boy and seeking for a job" not more than 10 characters including space in one line,rest characters should b in other line.if the next line starts from in between the previous word,then print whole word to next line.

1789


Why do pointers exist?

655


write a code for this. serial_number contained in the header of the file will be read , if this serial number is less than a previous serial number within a successfully processed file, or is the same as another serial number within a successfully processed file, or if the field contains anything other than 7 digits, then the file must error with the reason ‘Invalid SERIAL_NUMBER’.

1774


What is persistence in oop?

667


What is Difference Between Inheritance and creating object and getting data? means Class A extends B{ B.getMethod();} (OR) Class A{ b obj=new B(); obj.getMethod(); }

1977


Can enum be null?

583