Minggu, 24 Oktober 2010
class MethodParameter
{
/*
static int num1 =3;
static int num2 =5;
*/
static int answer =0;
public static void main(String[] args)
{
int result = yes(4,7);
System.out.println(result);
}
private static int yes(int num1,int num2)
{
answer = num1+num2;
return answer;
}
};
Label: Programming Java
class Jumlah
{
static int num1 = 8;
static int num2 = 7;
static int answer = 0;
public static void main(String[] args)
{
System.out.println(jumlah());
}
private static int jumlah()
{
answer = num1 + num2;
return answer;
}
}
Label: Programming Java
class Hello
{
public static void main(String[] args){
yes();
}
private static void yes()
{
System.out.println(" Cetak ini ");
}
}
Langganan:
Postingan (Atom)