- System.out.print adalah untuk menampilkan teks di layar
- contoh: System.out.print
- System.out.print("welcome to Netbeans");
- Contoh: System.out.println
- System.out.println("line1");
JOptionPane.showInputDialog
- JoptionPane J=new JOptionPane ();
- String julukan=JoptionPane.showInputDialog("panggilan")
- System.out.println(julukan)
- Char = 1 huruf "a"
- String = lebih dari 1 huruf "budi" (kalo pake string tidak usah d tulis ulang)
- Int = anka bilangan bulat [(-3500) => (+3500)]
- Long = angka bilangan bulat [Lebih dari (+3500)]
- Float = bilangan pecahan / desimal [(-3500) => (+3500)]
- Double = bilangan pecahan / desimal [lebih dari (+3500)]
Noteped++
My computer-> klik kanan(properties)-> Advanced(Environment Variables)-> new name(PATH) value (C:\Program File\java\jdk1.6.0_11\bin)-> OK
masuk program noteped=
co 1:
public class Main
{
public static void main(String[] args)
{
// TODO code application logic here
int cel=32;
float fah= (float)(cel*1.8)+32;
float rea= (float)(0.8*cel);
System.out.println(cel + "total " +fah +" Farenheit" );
System.out.println(cel + "total " +rea +" reamut" );
}
}
Tidak ada komentar:
Posting Komentar