Public and Private in JAVA! Explained with Examples

Veröffentlicht am: 14 Juni 2026
auf dem Kanal: Programador MP
186
like

Public vs. Private in Java: Learn how access modifiers work in Java and when to use public or private attributes in Object-Oriented Programming (OOP).

In this tutorial, we'll look at practical examples to understand how to control access to attributes and classes, how to import classes from other packages, and why some attributes can be used from other classes while others remain restricted.

You'll also learn how the public and private access modifiers work, a fundamental concept before moving on to encapsulation, constructors, inheritance, and other important pillars of Java.

If you're learning Java from scratch or want to improve your Object-Oriented Programming skills, this video will help you understand one of the most important concepts in the language.

00:00 Introduction
00:44 Creating a new package
00:58 Creating a new class
01:21 Importing classes from another package
02:24 What happens if we don't use access modifiers?

03:05 Public Access Modifier
04:24 Private Access Modifier
05:28 Conclusion

#Java #OOP #ObjectOrientedProgramming #JavaTutorial #Programming #SoftwareDevelopment #JavaDeveloper #Backend #Coding #softwaredevelopment #code


Auf dieser Seite können Sie das Online-Video Public and Private in JAVA! Explained with Examples mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Programador MP 14 Juni 2026 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 186 Mal angesehen und es wurde von like den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!