Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class nilai {
- double price;
- class Ujianmid{
- String MID;
- double nilaiMID(){
- return 8.3;
- }
- }
- protected class UjianNasional{;
- String UN;
- double nilaiUN(){
- return 8.5;
- }
- }
- }
- public class classandobject {
- public static void main(String[] args) {
- nilai nilai = new nilai();
- nilai.Ujianmid Ujianmid = nilai.new Ujianmid();
- nilai.UjianNasional UjianNasional = nilai.new UjianNasional();
- System.out.println("Nilai MID Semester = " + Ujianmid.nilaiMID());
- System.out.println("Nilai Ujian Nasional = " + UjianNasional.nilaiUN());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment