Tip Dönüşümleri (Type Conversation And Casting)

long, int, short, byte, float, double, boolean, char ve String tiplerinin bir birlerine dönüşümleri

    long int short byte
a long   long a=(long) b long a=(long) c long a=(long) d
b int int b=(int) a   Int b=(int) c int b=(int) d
c short short c=(short) a short c=(short) b   short c=(short) d
d byte byte d=(byte) a byte d=(byte) b byte d=(byte) c  
           
e double double e=(double) a double e=(double) b double e=(double) c double e=(double) d
f float float f=(float) a float f=(float) b float f=(float) c float f=(float) d
           
g boolean boolean g=(boolean) a boolean g=(boolean) b boolean g=(boolean) c boolean g=(boolean) d
           
h char char h=(char) a char h=(char) b char h=(char) c char h=(char) d
k String String k=Long.toString(a) String k=Integer.toString(b) String k=Short.toString(c) String k=Byte.toString(d)

    double float
a long long a=(long) e long a=(long) f
b int int b=(int) e int b=(int) f
c short short c=(short) e short c=(short) f
d byte byte d=(byte) e byte d=(byte) f
       
e double   double e=(double) f
f float float f=(float) e  
       
g boolean boolean g=(boolean) e boolean g=(boolean) f
       
h char char h=(char) e char h=(char) f
k String String k=Double.toString(e) String k=Float.toString(f)

 

    boolean
a long long a=(long) g
b int int b=(int) g
c short short c=(short) g
d byte byte d=(byte) g
     
e double double e=(double) g
f float float f=(float) g
     
g boolean  
     
h char char h=(char) g
k String String k=Boolean.toString(g)

 

    char String
a long long a=Character.toString(h).charAt(0) long a=Long.toString(k)
b int int b=(int) h int b=Integer.toString(k)
c short short c=(short) h short c=Short.toString(k)
d byte byte d=(byte) h byte d=Byte.toString(k)
       
e double double e=(double) h double e=Double.toString(k)
f float float f=(float) h float f=Float.toString(k)
       
g boolean boolean g=(boolean) h boolean g=Boolean.toString(k)
       
h char   char h=Character.toString(k)
k String String k=Character.toString(h)  

 

Yorumunuzu Ekleyin


Yükleniyor...
Yükleniyor...