Wednesday, February 29, 2012

Variable Info

Public class test{
static void go(Integer x){
System.out.println("Integer");
}
static void go(long x){
System.out.println("long");
}
static void go(byte x){
System.out.println("byte");
}
static void go(char x){
System.out.println("char");
}
public static void main(String[]args) {
int i=5;
go(i);
}

Console: netice long olacaq.cunki java setir setir oxuyur.ilk once ozone uygun primitive tipi axtarir.yeni kohne usuldan istifade edir.eger ozune uygun primitive zeif olarsa o zaman ozunun wrapper novunu secir.serte gore:
1. Primitive tip
2. Wrapper
3. “…” istifade olunur.
Int longun terkibinde oldugundan ve long evvelde geldiyi ucun longu secir.yeni
X=I;
Olur.int long-a menimsedilir.(32 bit 64 bite menimsedilir).eger int-e uygun int,long double olsa o zaman int ilk once ozone en yaxin olan int-I goturecek.eger int olmasa o zaman longu goturecek.yeni ozune uygun olan bitden yuxariya dogru olanlari goturecek.

No comments:

Post a Comment