Senin, 15 Oktober 2012

Tugas Java


Kode :
public class Oktavianus 
 public static void main(String[] args) 
                { 
        // say hello to the world 
        System.out.println("Welcome to Java Programming Oktavianus!!!!"); 
    } 
}





  Kode :
public class TheTreeOktavianus 
    public static void main(String[] args) 
    { 
        // say hello to the world 
        System.out.println("I think that I shall never see,"); 
                System.out.println("a poem as lovely as a tree.");
                System.out.println("A tree whose hungry mouth is pressed");
                System.out.println("Against the Earths sweet flowing breast.");
    } 
}




Kode :
public class bab4Oktavianus 
    public static void main(String[] args) 
    { 
                int a=10;
                                int b=10;
                                int number=15;
                                char letter;
                                letter= 'a' ;
                                boolean val = false;
                                String str= "hello";

                                System.out.println("Number = " + a);
                                if( number > b)
                                System.out.println("letter = " + letter);
                else
                System.out.println("letter = b");
                                System.out.print( "Result=" );
                                System.out.println(!val);
                                System.out.println("str = " + str );
    } 
}

Tidak ada komentar:

Posting Komentar