+201223538180

neoweb4u|Web site Developer I Advertising I Social Media Advertising I Content material Creators I Branding Creators I Administration I System Answer|Java Tutorial: Entry modifiers, getters & setters in Java

neoweb4u|Web site Developer I Advertising I Social Media Advertising I Content material Creators I Branding Creators I Administration I System Answer|Java Tutorial: Entry modifiers, getters & setters in Java

Neoweb4u


Neoweb4u|Java entry modifiers: On this video, we are going to see learn how to use entry modifiers in Java. Java gives public, default, non-public and guarded entry modifiers. We’ll …

supply

36 thoughts on “neoweb4u|Web site Developer I Advertising I Social Media Advertising I Content material Creators I Branding Creators I Administration I System Answer|Java Tutorial: Entry modifiers, getters & setters in Java

  1. 👏🏻👏🏻👏🏻

  2. solution of finding area of circle
    class circle {

    private int radius;

    public void setradius(int r) {

    radius = r;

    }

    public double area() {

    return 3.142 *radius*radius;

    }

    public double perimeter() {

    return 2 * 3.142 *radius;

    }

    }

    public class radius_of_circle {

    public static void main(String[] args) {

    circle c = new circle();

    c.setradius(4);

    System.out.println("The area of the circle is "+c.area());

    System.out.println("The perimeter of the circle is "+c.perimeter());

    }

    }

  3. Keyboard noice is so satisfying man!!😍

  4. Can you please share the link of your Encapsulation chapter…I am not able to find it.. 🙏

  5. class Circle{

    private float radius;

    private float pi;

    public float Area(){

    return pi *(radius*radius);

    }

    public float Perimetre(){

    return 2*(pi*radius);

    }

    public float getRadius(){

    return radius;

    }

    public void setRadius(float R){

    radius=R;

    }

    public float getPi(){

    return pi;

    }

    public void setPi(float P){

    pi=P;

    }

    }

    public class PracticeSet {

    public static void main(String[] args) {

    Circle C = new Circle();

    C.setRadius(3);

    //System.out.println(C.getRadius());

    C.setPi(3.14f);

    // System.out.println(C.getPi());

    System.out.println(C.Area());

    System.out.println(C.Perimetre());

    }

    }

  6. This is one of the best course

  7. class circle{

    private float radius;

    public void setRadius(float radii) {

    this.radius = radii;

    }

    public float getArea() {

    return radius*radius*3.14f;

    }

    public float getcircum() {

    return radius*2f*3.14f;

    }

    }
    public class SetterSettersCwh40 {

    public static void main(String[] args) {

    circle rad = new circle();

    rad.setRadius(3);

    System.out.println(rad.getArea()+" "+ rad.getcircum());

    }

    }

  8. Elon musk k bache ka naam me int aata hai. Aap galat btaa rahe ho.

  9. sir program likhne k baad jab aap last m samjha dete ho to bhut ache se samajh m aata h aise hi kiya kro aap

  10. i really got this concept and loved the soundtrack at the end of the video.

  11. Boss apki video ko 2-3 tym dekhne ki zarurat hoti h jbi smjh m aata h 🙏

  12. hey harry can you please explain the use of getter and setter here?

  13. harry bhai aapki har ek videos dekhta hu par prblm ek hi hai sab me… kam ki baat kam hai aur faltu ki bakchodia jyada hai… aap talented ho no doubt bas bakchodi itni krte ho ki bohot

  14. I have written this code just check it :
    class circle1{

    private int radius;

    public void setRadius(int ra){

    radius = ra;

    }

    public int getRadius(){

    return radius;

    }

    public void setPerimeter(int per){

    radius = per;

    }

    public int getPerimeter(){

    return radius;

    }

    }
    public static void main(String[] args) {
    circle1 meas = new circle1();

    meas.setPerimeter(7);

    meas.setRadius(5);

    System.out.println(meas.getPerimeter()* meas.getPerimeter());

    System.out.println((2*meas.getRadius())+ meas.getRadius());

    }

    }

  15. 3:18
    getter setter method Thanks

  16. please check this for me someone for the problem mentioned in the ending of this particular lecture:

    class Circle{

    private int radius;

    public void setradius(int ra){

    radius=ra;

    }

    public int getradius(){

    return radius;

    }

    public int perimeter(int rs){

    radius=rs;

    return radius*radius;

    }

    public int area(int rss){

    radius=rss;

    return 2*radius+radius;

    }

    }

    public class Exercise_2{

    public static void main(String[] args) {

    Circle r=new Circle();

    System.out.println(r.area(5));

    }

    }

  17. class Rectangle{
    private double length;
    private double breadth;

    public double getlength(){
    return length;
    }
    public void setlength(double c){
    length=c ;
    }
    public void setbreadth(double d){
    breadth=d;
    }
    public double getbreadth(){
    return breadth;
    }

    }
    public class MyClass{
    public static void main(String[]args){
    Rectangle rc=new Rectangle();
    rc.setbreadth(5);
    rc.setlength(7);
    System.out.println(rc.getlength()*rc.getbreadth());
    System.out.println((2*rc.getlength())+(2*rc.getbreadth()));

    }
    }

  18. After making of package in vs code throws main class do not load why? Without package it's running .

  19. Hello !!! Private method ko bhi to explain karo!! Simple sa bata k chodd diya app to…

  20. Bhai samajh nahi aaya kya kahne chahte aap.. jaise agar main galat name set karta jaise String ke jagah number dalunga to wo kuch return kare to aisa ho hi nahi shakta qki wo error show karega jaise agar String name; use kara hai aur name me number set kar rahen to ofc error aayega , same case for methods jo name set karta jaise public String setName(String n) aur maine set kar diya number -> object.setName(10); fir to ye error show kar dega to main return me aur kuch kaise show karunga?????

  21. Bro baki ke access modifiers nahi batayen? aur tbh mujhe abhi tak nahi smjh me aya ki private variables q banayenge hum….Explain if anyone can.

  22. Ye wali class smjh ni aya

  23. package oops;

    class Circle{

    private int radius ;

    private int area ;

    private int perimeter ;

    public int getradius( ) {

    return radius ;

    }

    public void setradius(int n) {

    this.radius= n;

    }

    public int getarea( ) {

    return area ;

    }

    public void setarea(double a) {

    this.area= (int) a;

    if(a==3.14*radius*radius) {

    System.out.println("The value of area is correct ");

    }else {

    System.out.println("wrong area ");

    }

    }

    public int getperimeter() {

    return perimeter;

    }

    public void setperimeter(double p) {

    this.perimeter= (int)p; // double to int typecast

    if(p==2*3.14*radius) {

    System.out.println("The value of perimter is correct");

    }else {

    System.out.println("wrong perimeter");

    }

    }

    }

    public class AccessModifiersExercise {

    public static void main(String[] args) {

    Circle cr = new Circle();

    cr.setradius(2);

    cr.setarea(12.56);

    cr.setperimeter(12.56);

    System.out.println(cr.getarea());

    System.out.println(cr.getperimeter());

    }

    }

    sir is this correct code for the activity which you given

  24. import java.util.Scanner;

    class Circle{

    Scanner sc = new Scanner(System.in);

    int redius = sc.nextInt();

    private float area;

    private float perimeter;

    public float getArea(){

    return 3.14f*redius*redius;

    }

    public float getPerimeter(){

    return 2*3.14f*redius;

    }

    }

    public class getset {

    public static void main(String[] args) {

    System.out.println("Please Enter a Redius : ");

    Circle r = new Circle();

    System.out.println("Area of circle is : "+r.getArea());

    System.out.println("Perimeter of circle is : "+r.getPerimeter());

    }

    }

  25. Thank you so much for your amazing videos… It feels like Concept on OOPs is clear after watching these tutorials of urs.😊

  26. FYI: Elon Musk's child name is Xaeaxii12

  27. yrr harry bhai thanku dil se java ke liye mujhe lg nhi rha tha itne aache se koi pdha sakta h opps conspt

  28. 3:4 – ये जो कर रहे हो आप, सही नही कर रहे हो….😂😂😂😂

  29. Sir how do we use private access modifier with arrays?

  30. import java.util.Scanner;
    // PERIMETER AND AREA CHECKING SYSTEM
    // Program to check if the entered area and perimeter are
    // correct using getters, setters and access modifiers
    public class area {

    private double radius;
    private double Perimeter;
    private double area;
    public void setRadius(double radius){
    this.radius=radius;
    }
    public void setPerimeter(double Perimeter){
    if (Perimeter== getPerimeter()){
    this.Perimeter=Perimeter;
    System.out.println(getPerimeter()+" is the correct perimeter.");
    }
    else{
    System.out.println("WRONG PERIMETER");
    }
    }
    public void setArea(double area){
    if (area== getArea()){
    this.area=area;
    System.out.println(getArea()+" is the correct area.");
    }
    else{
    System.out.println("WRONG AREA");
    }

    }
    public double getPerimeter(){
    return 3.14*radius*radius;
    }
    public double getArea(){
    return 2*3.14*radius;
    }
    public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    System.out.print("ENTER PERIMETER: ");
    double perimeter= sc.nextDouble();
    System.out.print("ENTER AREA: ");
    double area= sc.nextDouble();
    area circle= new area();
    circle.setRadius(7);
    circle.setPerimeter(perimeter); //P= 153.86, A= 43.96 are the correct values
    circle.setArea(area);
    }
    }

  31. Bro agr private methods ko access Krna ho to kaise krenge

  32. If i only i had met someone like you in my engg days, i would love programming 😐

Leave a Reply