Professional Documents
Culture Documents
*;
public class Hello extends MIDlet implements CommandListener { private Command exitCommand; private orm !;
public Hello"# { ! $ ne% orm"&Hello 'orld&#; exitCommand $ ne% Command"&Exit&( Command.E)I*( +#; !.addCommand"exitCommand#; !.setCommandListener"t,is#; -
noti!/Destro/ed"#; -
12M23 .4C import java.io.4u!!ered1eader; import java.io.Input3tream1eader; import java.io.IOException ; public class 1umus.4C {
public static void main " 3trin056 ar0s #t,ro%s IOException { double a(b(c(x+;
4u!!ered1eader input$ ne% 4u!!ered1eader"ne% Input3tream1eader"3/stem.in##; 3/stem.out.print"&m $ &#; a$Double.parseDouble"input.readLine"##; 3/stem.out.print"&0 $ &#; b$Double.parseDouble"input.readLine"##; 3/stem.out.print"&, $ &#; c$Double.parseDouble"input.readLine"##;
3.L.M 8* * *o c,an0e t,is template( c,oose *ools 9 *emplates * and open t,e template in t,e editor. *8
pac:a0e javaapplication;;
8** * <param ar0s t,e command line ar0uments *8 public static void main"3trin056 ar0s# { 88 *ODO code application lo0ic ,ere 3/stem.out.println"&3a/a sedan0 belajar =ava...&#; -
*.M4.H >.M. import java.io.4u!!ered1eader; import java.io.Input3tream1eader; import java.io.IOException; public class Input { public static void main " 3trin056 ar0s # { 4u!!ered1eader dataIn $ ne% 4u!!ered1eader"ne% Input3tream1eader" 3/stem.in# #; 3trin0 name $ &&; 3/stem.out.print"&?lease Enter @our >ameA&#; tr/ { name $ dataIn.readLine"#; - catc," IOException e # { 3/stem.out.println"&ErrorB&#; 3/stem.out.println"&Hello & 7 name 7&B&#; 3.L.M 8* * *o c,an0e t,is template( c,oose *ools 9 *emplates * and open t,e template in t,e editor. *8
pac:a0e javaapplicationC;
8** * <param ar0s t,e command line ar0uments *8 public static void main"3trin056 ar0s# { 88 *ODO code application lo0ic ,ere =Option?ane.s,o%Messa0eDialo0"null( &3a/a sedan0 belajar =ava&( &3alamE&( +#;
3/stem.exit"F#; -
M.M.LI. D.1.* 8* * *o c,an0e t,is template( c,oose *ools 9 *emplates * and open t,e template in t,e editor.
*8
pac:a0e javaapplicationG;
8** * <param ar0s t,e command line ar0uments *8 public static void main"3trin056 ar0s# { 88 *ODO code application lo0ic ,ere 3trin0 suaraHe%an $ &&;
class Jucin0 { public 3trin0 men0eon0"# { 3trin0 suara $ ne% 3trin0"&Meoooon0...&#; return suara; O?E1.3I 4I* 8* * *o c,an0e t,is template( c,oose *ools 9 *emplates * and open t,e template in t,e editor. *8
pac:a0e javaapplicationK;
8**
* <param ar0s t,e command line ar0uments *8 public static void main"3trin056 ar0s# { 88 *ODO code application lo0ic ,ere b/te x $ KG; int / $ G; int ,asil>ot( ,asil.nd( ,asilOr( ,asil)or;
3/stem.out.println"&Hn*estin0.....Hn&#;
DEMO M.*EM.*IJ. 8* * *o c,an0e t,is template( c,oose *ools 9 *emplates * and open t,e template in t,e editor. *8
pac:a0e javaapplicationO;
public static void main"3trin056 ar0s# { 88 *ODO code application lo0ic ,ere double a $ +FF.F; double b $ P.F; double ,asil=umla,( ,asilJuran0( ,asilJali( ,asil4a0i;
,asil=umla, $ ,itun0.jumla,"a( b#; ,asilJuran0 $ ,itun0.:uran0"a( b#; ,asilJali $ ,itun0.:ali"a( b#; ,asil4a0i $ ,itun0.ba0i"a( b#;
O?E1.*O1 =.Q. 8 R 8* * *o c,an0e t,is template( c,oose *ools 9 *emplates * and open t,e template in t,e editor. *8
pac:a0e javaapplicationR;
8** * <param ar0s t,e command line ar0uments *8 public static void main"3trin056 ar0s# { 88 *ODO code application lo0ic ,ere boolean test $ !alse;
3/stem.out.println"&HnCoba Operator....Hn&#;
3/stem.out.println"&.pa:a, object demo merupa:an & 7 &instans dari DemoOperator T A & 7 test#;
DEMO I 8 U 8* * *o c,an0e t,is template( c,oose *ools 9 *emplates * and open t,e template in t,e editor. *8
88pac:a0e javaapplicationU;
8** * <param ar0s t,e command line ar0uments *8 public static void main"3trin056 ar0s# { 88 *ODO code application lo0ic ,ere double nilaiInput;
pac:a0e javaapplication+F;
8** * <param ar0s t,e command line ar0uments *8 public static void main"3trin056 ar0s# { 88 *ODO code application lo0ic ,ere 3/stem.out.println"&HnCoba 4uat *eba:an =umla, Dua 4ua, Dadu....Hn&#;
i!"teba:an $$ ,asilDuliran# { 3/stem.out.println"&HnHebat... *eba:an .nda benar...BBBBB&#; - else { 3/stem.out.println"&Maa!... *eba:an .nda belum benar...BBBBB&#; 3/stem.out.println"&Hasil Duliran Dua Dadu adala, A & 7 ,asilDuliran#; - else { 3/stem.out.println"&.nda memasu::an bilan0an & 7 &/an0 invalid....BBBBBB&#; -
public int 0ulirDuaDadu"# { int dadu+( dadu;( jumla,DuaDadu; dadu+ $ + 7 "int# " Mat,.random"# * K #; dadu; $ + 7 "int# "Mat,.random"# * K #; jumla,DuaDadu $ dadu+ 7 dadu;;
return jumla,DuaDadu; -
4u!!ered1eader input$ ne% 4u!!ered1eader"ne% Input3tream1eader"3/stem.in##; 3/stem.out.print"&m $ &#; m$Double.parseDouble"input.readLine"##; 3/stem.out.print"&0 $ &#; 0$Double.parseDouble"input.readLine"##; 3/stem.out.print"&, $ &#; ,$Double.parseDouble"input.readLine"##;
*EJ3 IELD 8 +;
pac:a0e javaapplication+;;
public static void main"3trin056 ar0s# { = rame !rame $ ne% = rame"&4uat *ext ield&#; =Label label $ ne% =Label"&>ama A&#; =*ext ield text ield $ ne% =*ext ield";F#; !rame.0etContent?ane"#.setLa/out"ne% lo%La/out"##; !rame.0etContent?ane"#.add"label#; !rame.0etContent?ane"#.add"text ield#; !rame.pac:"#; !rame.setQisible"true#; !rame.setDe!aultCloseOperation"= rame.E)I*XO>XCLO3E#; -
8** * <param ar0s t,e command line ar0uments *8 public static void main"3trin056 ar0s# { 88 *ODO code application lo0ic ,ere -