Skip to content

Instantly share code, notes, and snippets.

@isauravmanitripathi
Created March 26, 2019 17:26
Show Gist options
  • Save isauravmanitripathi/7ee74b7237e232453cbca35846852f28 to your computer and use it in GitHub Desktop.
Save isauravmanitripathi/7ee74b7237e232453cbca35846852f28 to your computer and use it in GitHub Desktop.
// 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