Created
March 26, 2019 17:26
-
-
Save isauravmanitripathi/7ee74b7237e232453cbca35846852f28 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// account.java | |
// Account class that contains a name instance variable | |
// and methods to set and get its value. | |
public class account { | |
private String name; // instance variable | |
// method to set the name in the object | |
public void setName(String name);{ | |
this.name = name; // store the name | |
} | |
// method to retrieve the name from the object | |
public String getName() { | |
return name; // return the value of the name to caller | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment