Computer Science, asked by midhunappuz, 4 months ago

Encapsulation java program​

Answers

Answered by pratyasha86
0

Answer:

//It has a private data member and getter and setter methods.

package com.javatpoint;

public class Student{

//private data member

private String name;

//getter method for name

public String getName(){

return name;

}

//setter method for name

public void setName(String name){

this.name=name

}

}

Similar questions