twitter
rss


A.    1. Tipe Data
 class contohinteger
            {
                        public static void main(string agrs[])
                        {
                        int nilai;
                        nilai = 95;
                                    System.out.println(“Nilai : “ + nilai);
                        }
            }


B.    2. String
 class contohstring
            {
                        public static void main(string agrs[])
                        {
                        String nama;
nama = “STIKOM BALI”;
                                    System.out.println(“Nama : “ + nama);
}
}


C.     3. Contoh Penggunaan Operator

 class contohOpl
            {
                        public static void main(String agrs[])
                        {
                        String nama,nim;
                        int nilai
                       
                        nama = “Lutung Kasarung”;
                        nim = “040010350”;

                        nilai = 95;
                        nilai += 5;

System.out.println(“==============”);
                                    System.out.println(“Nama    : “ + nama);
                                    System.out.println(“NIM       : “ + nim);
                                    System.out.println(“Nilai: “ + nilai);
                                    System.out.println(“==============”);
                        }
            }


Dari contoh di atas, nilai yang akan tampil akan berubah manjadi 100. Karena, nilai 95 mengalami penambahan 5 angka. Yaitu, nilai +=5 atau  nilai = nilai+5. Output yang dihasilkan adalah :

                        ============================
                        Nama  : Lutung kasarung
                        NIM     : 040010350
                        Nilai    : 100
                        ============================



A.    1. Tipe Data
 class contohinteger
            {
                        public static void main(string agrs[])
                        {
                        int nilai;
                        nilai = 95;
                                    System.out.println(“Nilai : “ + nilai);
                        }
            }


B.    2. String
 class contohstring
            {
                        public static void main(string agrs[])
                        {
                        String nama;
nama = “STIKOM BALI”;
                                    System.out.println(“Nama : “ + nama);
}
}


C.     3. Contoh Penggunaan Operator

 class contohOpl
            {
                        public static void main(String agrs[])
                        {
                        String nama,nim;
                        int nilai
                       
                        nama = “Lutung Kasarung”;
                        nim = “040010350”;

                        nilai = 95;
                        nilai += 5;

System.out.println(“==============”);
                                    System.out.println(“Nama    : “ + nama);
                                    System.out.println(“NIM       : “ + nim);
                                    System.out.println(“Nilai: “ + nilai);
                                    System.out.println(“==============”);
                        }
            }


Dari contoh di atas, nilai yang akan tampil akan berubah manjadi 100. Karena, nilai 95 mengalami penambahan 5 angka. Yaitu, nilai +=5 atau  nilai = nilai+5. Output yang dihasilkan adalah :

                        ============================
                        Nama  : Lutung kasarung
                        NIM     : 040010350
                        Nilai    : 100
                        ============================

Free Template Blogger collection template Hot Deals BERITA_wongANteng SEO theproperty-developer

0 komentar:

Posting Komentar