P.E.M.I.M.P.I

Meraih Mimpi Demi Masa Depan

 
Sponsors
Adsense Indonesia
Books

Masukkan Code ini K1-9C219D-B
untuk berbelanja di KutuKutuBuku.com
Program Afiliasi Ebook-id
ShoutMix
Upload Files
Jaringan Url
Earn Money Easily
Contoh Program Penggunaan Type Data Primitive
Sabtu, 13 Februari 2010
Berikut adalah contoh program type data primitive yang telah disesuaikan dengan aturan yang berlaku dalam setiap penugasannya. Suatu saat nanti kita bisa mempelajari sesuatu hal seperti operators dan flow control. Dengan menggunakan type data primitive penggunaan operators dan flow control akan terasa lebih menyenangkan.

            1          /*
2          *Berikut contoh penggunaan type data primitive
3         */
4          class PrimitivesInAction{
5                      public static void main(String[] args){
6                                  byte aByte = 25;
7                                  short aShort = 50;
8                                  int anInteger = 100;
9                                  long aLong = 1000L;
10                                float aFloat = 1.34F; // Ingat huruf ‘F’!
11                                double aDouble = 1.34;
12                                boolean aBoolean = true;
13                                System.out.println(“Byte: “ + aByte);
14                                System.out.println(“Short: “ + aShort);
15                                System.out.println(“Integer: “ + anInteger);
16                                System.out.println(“Long: “ + aLong);
17                                System.out.println(“Float: “ + aFloat);
18                                System.out.println(“Double: “ + aDouble);
19                                System.out.println(“Boolean: “ + aBoolean);
20                    }
21       }
Selanjutnya mari kita lakukan kompilasi dan eksekusi terhadap scripts (kode) diatas. Hasil dari eksekusi diatas akan tercetak berupa nilai dari setiap penugasan.

Sign up for PayPal and start accepting credit card payments instantly.
posted by Deni @ 01.44  
0 Comments:

Posting Komentar

<< Home
 
About Me

Name: Deni
Home: Bandung, Indonesia
About Me: Simple
See my complete profile
Previous Post
Archives
Affiliate Programs
Template by

Blogger Templates

BLOGGER

Traffic Rank
Free Web Counter
HTML Counter
Business Opportunities