Buzz Chronicles
Follow
  • Home
  • Threads
    • Daily Charts
    • Most Popular
    • Most Recent
  • Authors
  • Categories
    • Life
    • Tech
    • Culture
    • Politics
    • Society
    • Fun
    • See All Categories
  • About

IamKishor_P Categories Access modifiers

7 days 30 days All time Recent Popular
Vikas Rajput
Vikas Rajput
@vikasrajputin
Java: Acess Modifiers

a thread...

(Cheatsheet Included)

What is an access modifier?

Access Modifiers are a way of providing limited visibility to methods, variables, classes.

Different access modifiers provide different visibility due to which our program because less prone to unwanted changes.

Java has four access modifiers, let's see each one by one

public:
It's the least restrictive access modifier when any class, method, or variable is defined as public then it is accessible from anywhere.

protected:
Protected methods & variables can be accessed within the same package and also accessible to all child classes.

default:
When no access modifier is specified then java treats it as default. With default methods & variables are accessible within the same package.

private:
It's the most restrictive access modifier, when given to any methods & variable it is only accessible within the same class.
ACCESS MODIFIERS
  • Page 1 of 1
How does it work?
  • 💬 Reply to a thread with "@buzz_chronicles save" or "@buzz_chronicles save as category"
    🤖 Our bot will send you a link to your own folder on Buzz Chronicles. The thread will be saved in a form of an easy-to-read article
    📁 All your saved threads will be available at buzzchronicles.com/your_twitter_handle
Buzz Chronicles
  • Explore
  • Threads
  • Daily Charts
  • Authors
  • Categories
  • About
  • Terms of Service

Copyright © 2021 Buzz Chronicles - All right reserved