Skip to content

Instantly share code, notes, and snippets.

@timxor
Created January 31, 2014 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timxor/8729566 to your computer and use it in GitHub Desktop.
Save timxor/8729566 to your computer and use it in GitHub Desktop.
package lab1;
public class Student {
private final String firstName, lastName;
private String username;
private final int id;
private final boolean isFulltime;
private void generateUsername(String username) {
String temp = firstName.substring(0, 1) + lastName.substring(0, 6);
username = temp.toLowerCase();
this.username = username;
}
public Student(String firstName, String lastName, int id, boolean isFulltime) {
this.firstName = firstName;
this.lastName = lastName;
this.id = id;
this.isFulltime = isFulltime;
generateUsername()
}
public Student(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
id = 0;
isFulltime = true;
}
public static void main(String[] args) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment