8.1 What is Encapsulation in Java Tutorial

///8.1 What is Encapsulation in Java Tutorial

8.1 What is Encapsulation in Java Tutorial

FavoriteLoadingAdd to favorites

Join the live batch :

Java468x60

Recommend Books :

1. Head First Java :
2. Java Complete Reference :

Join the live batch :

For code click here

Encapsulation in Java
Binding Data with Method
Getters and Setters
Data Hiding

Encapsulation is one of the four fundamental OOP concepts.

Encapsulation is the technique of making the fields in a class private and providing access to the fields via public methods.

If a field is declared private, it cannot be accessed by anyone outside the class, thereby hiding the fields within the class
Encapsulation is one of the four fundamental OOP concepts.

Encapsulation can be defined as a process of wrapping code and data together into a single unit.

Encapsulation is the technique of making the fields in a class private and providing access to the

fields via public methods.

If a field is declared private, it cannot be accessed by anyone outside the class, thereby hiding the

fields within the class

Editing Monitors :

Editing Laptop :
ASUS ROG Strix – (new version)

Camera :
lens :

Mics

Check out our website:

Follow Telusko on Twitter:

Follow on Facebook:
Telusko :
Navin Reddy :

Follow Navin Reddy on Instagram:

Subscribe to our other channel:
Navin Reddy :
Telusko Hindi :

Subscribe to the channel and learn Programming in easy way.

Java Tutorial for Beginners :

Scala Tutorials for Java Developers :

C Tutorial Playlist :

Android Tutorial for Beginners Playlist :

XML Tutorial :

Design Patterns in Java :

Socket Programming in Java :

Spring MVC Tutorial :

OpenShift Tutorial for Beginners :

Spring Framework with Maven :

Sql Tutorial for Beginners :

String Handling in Java :

Array in Java :

Java Servlet :

Exception Handling in Java :

source

By |2019-08-01T21:33:17+00:00August 1st, 2019|Java Video Tutorials|35 Comments

35 Comments

  1. Maaddu Sathish Kumar Reddy August 1, 2019 at 9:33 pm - Reply

    Sir, add another video related to encapsulation(how it hide unwanted information and shows only necessary information)

  2. Ajit Jamatia August 1, 2019 at 9:33 pm - Reply

    public class test{

    private int i,j;

    public void setI(int j)

    {

    i=j;

    }

    public int getI()

    {

    return i;

    }

    public static void main(String[ ] args){

    main ob=new main();

    ob.setI(2);

    System.out.println(ob.getI());

    }

    }

  3. NIIT NH August 1, 2019 at 9:33 pm - Reply

    some real time example for encapuslation???

  4. shivam kumar August 1, 2019 at 9:33 pm - Reply

    Thanks a lot!

  5. Niraj P. August 1, 2019 at 9:33 pm - Reply

    You are amazing, you making it so easy to understand. Thank you sir.

  6. Kishore Tangudu August 1, 2019 at 9:33 pm - Reply

    Anyway you are allowing the user to set value right … Then how exactly you providing safe fairs access??

  7. Ram Ramesh August 1, 2019 at 9:33 pm - Reply

    Sir.. In this encapsulation getters and setter method is mondatory or we can use instant methods also…??

  8. gaming world August 1, 2019 at 9:33 pm - Reply

    By this i got to know that software job guys loss there hair

  9. sagar roy August 1, 2019 at 9:33 pm - Reply

    video quality is poor

  10. Bhavani M August 1, 2019 at 9:33 pm - Reply

    why should v change the value using method?? what is the use out of it. Please reply

  11. ARC August 1, 2019 at 9:33 pm - Reply

    video isn't clear

  12. nischal bhatt August 1, 2019 at 9:33 pm - Reply

    Whats the pt of encapsulation?

  13. Pirzada Salman August 1, 2019 at 9:33 pm - Reply

    Something wrong in the main() !
    This Statement Should be like; System.out.println(obj.getI());

  14. Utkarsh singh August 1, 2019 at 9:33 pm - Reply

    Easily understood sir… Perfect description..

  15. Nitesh Raj August 1, 2019 at 9:33 pm - Reply

    Thanks a lot sir your oops videos saved me …every questions in exam were from your videos ?

  16. Satyajeet Kumar August 1, 2019 at 9:33 pm - Reply

    Could we don't do…
    getI (int p, int q)
    {
    i=p:
    J=q
    }

  17. debraj roy August 1, 2019 at 9:33 pm - Reply

    poor video quality

  18. Amartya Aishwarya August 1, 2019 at 9:33 pm - Reply

    very poor video quality.. content is good, but no use if u cant see it properly

  19. coool stufff August 1, 2019 at 9:33 pm - Reply

    hey rap star !!! nice rap!!

  20. Siddharth Bhandari August 1, 2019 at 9:33 pm - Reply

    Hi for multiple variable we can use one setter method but getter method we should use seprate for each variable as per below

    package simple.practice;

    class Encapsulation_J {

    private int i, j;

    public void setI(int k, int l)

    {

    i=k;

    j=l;

    }

    public int getI()

    {

    return i;

    }

    public int getI1()

    {

    return j;

    }

    }

    class A

    {

    public static void main(String[] args) {

    Encapsulation_J e=new Encapsulation_J();

    e.setI(12, 15);

    System.out.println(e.getI1());

    System.out.println(e.getI());

    }

    }

  21. Siddharth Bhandari August 1, 2019 at 9:33 pm - Reply

    we need to call getI() using below

    System.out.println(obj.getI());

  22. Kamal Pandey August 1, 2019 at 9:33 pm - Reply

    Sir video is not clear

  23. Sheroth kar August 1, 2019 at 9:33 pm - Reply

    Max effort never waste keep going. sir!

  24. Jibran Zia August 1, 2019 at 9:33 pm - Reply

    You made it so easy, many thanx from Pakistan!

  25. Ritesh Kumar August 1, 2019 at 9:33 pm - Reply

    Good Explanation.

  26. Lancelot The Knight August 1, 2019 at 9:33 pm - Reply

    To those who are wondering, S.O.P() stands for System.out.print() okay?

  27. Deepak Kumar August 1, 2019 at 9:33 pm - Reply

    In your example although u have declared the property of class as private and u exposed accessor methods rather than accessing the property directly we can access using accessor methods so whats the difference in these approaches.

  28. Chaitanya Yarramsetti August 1, 2019 at 9:33 pm - Reply

    sir please make another video on encapsulation

  29. John R August 1, 2019 at 9:33 pm - Reply

    Thank you, Pajeet.

  30. Priya Gupta August 1, 2019 at 9:33 pm - Reply

    Why we need of encapsulation..plz give me reasnable ans..?

  31. Cartoon for kids August 1, 2019 at 9:33 pm - Reply

    should i learn java or python

  32. eXDee August 1, 2019 at 9:33 pm - Reply

    hello guys!!!!
    ive been deaf since.. 🙁

  33. Shubham Pund August 1, 2019 at 9:33 pm - Reply

    poor quality video

  34. Razib Ahsan August 1, 2019 at 9:33 pm - Reply

    man , you are describing it as very well but sorry to say you have low quality of video. you have to care of resulation while you are in turn of video.

  35. Abhishek Mhatre August 1, 2019 at 9:33 pm - Reply

    Use good quality 📷

Leave A Comment

*