What are different types of access modifiers?

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


Please Help Members By Posting Answers For Below Questions

Give us the name of the list layoutmanagers in java?

525


Describe string intern() methodology

597


Describe what happens when an object is created in java ?

553


Which sorting is best in java?

539


What is difference between path and classpath?

566






Can You Have Virtual Functions In Java?

589


What is identifier give example?

560


How java enabled high performance?

587


Why for each loop is used?

508


Explain about anonymous inner classes ?

581


What is difference between equals and hashcode method?

574


What do you mean by hashing?

646


What is the r character?

590


What are the benefits of operations in java?

493


List some oops concepts in java?

586