Created
October 12, 2017 17:59
-
-
Save Rahandi/769d56bc678efc3cc217e9697993003e to your computer and use it in GitHub Desktop.
Student
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
public class Siswa { | |
public static void main() { | |
Student siswanya = new Student(); | |
String nama; | |
nama = siswanya.getName(); | |
System.out.println(nama); | |
siswanya.printGrade(); | |
} | |
} |
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
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