Skip to content

Instantly share code, notes, and snippets.

@Rahandi
Created October 12, 2017 17:59
Show Gist options
  • Save Rahandi/769d56bc678efc3cc217e9697993003e to your computer and use it in GitHub Desktop.
Save Rahandi/769d56bc678efc3cc217e9697993003e to your computer and use it in GitHub Desktop.
Student
public class Siswa {
public static void main() {
Student siswanya = new Student();
String nama;
nama = siswanya.getName();
System.out.println(nama);
siswanya.printGrade();
}
}
public class Student {
private String namanya = "rahandi";
private double nilainya = 3.5;
public String getName(){
return namanya;
}
public void printGrade(){
System.out.println(nilainya);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment