ACCESS MODIFIERS :
- PUBLIC: access by any class & any package…..
- PRIVATE: can be accessed by only that class & not even by other classes of that package………
- PROTECTED: can be accessed by that class & it's package but can't be accessed by other packages….
- FINAL: s for that class which can't be derived (inherited) ….final with var makes it constant var (e,g final Pi=3.14 )& if we put final with method then that method can't be overwritten…
- ABSTRACT: (conceptual/theoretical) we can't make directly objects from it but we've to make inherited classes from it then it can be used ,we can't call abstract func directly……
- NATIVE: it informs java that a method’s implementations s an external C file that’s why it’s declearation s different that is native int me( ) ; . so it’s used to embed another lang prog in to java , but then java will become machine dependant..
- SYNCRONIZE: that a method s thread safe. Two or more prog can run at same time.
if we haven't put any access modifier then by default automatically it'll protected