//*********************************************************************//We introduce casting//*********************************************************************publicclass TypeCasting{publicstaticvoid main(String[] args){int mum1 =4;double num2 =5.56789;char ch ='l';//If we change a double into integer what happens//We use in order to cast a variable to other typesSystem.out.println("The integer value of num2 is "+num2);//If we change a character into integer what happens//It will give the ASCII value of the characterSystem.out.println("The integer value of ch is "+ch);}}
Henüz yorum yok.