Advertisement
Banta_Sandra

contoh program pemberian nilai java

Mar 23rd, 2013
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.92 KB | None | 0 0
  1. /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5. package bab2;
  6.  
  7. /**
  8.  *
  9.  * @author Bengkel IT Lhokseumawe
  10.  */
  11.  
  12. // Program Untuk mempelajari Pemberian Nilai Ke Suatu Tipe
  13. // Dalam pemrograman Java
  14.  
  15.  
  16. public class Percobaan1 {
  17.     public static void main(String[]args){
  18.         boolean b=true;
  19.         System.out.println("Boolean b: "+b);
  20.        
  21.         char c='C';
  22.         System.out.println("Char c: "+c);
  23.        
  24.         byte bt=10;
  25.         System.out.println("Byte: "+bt);
  26.        
  27.         short s=20;
  28.         System.out.println("Short: "+s);
  29.        
  30.         int i=30;
  31.         System.out.println("Integer: "+i);
  32.        
  33.         long l=40L;
  34.         System.out.println("Long: "+l);
  35.        
  36.         float f=3.14F;
  37.         System.out.println("Float: "+f);
  38.        
  39.         double d=3.14;
  40.         System.out.println("Doubel: "+d);
  41.        
  42.     }
  43.    
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement