get paid to paste

java-tut-typecasting-primitives-1

public class SampleConversion
{

 public static void main(String[]args)
 {
   int intVar = 1000;
   byte byteVar = (byte)intVar;
   char charVar = (char)intVar;

   System.out.println("byte: " + byteVar);
   System.out.println("int: " + intVar);
   System.out.println("char: " + charVar);
 }

}

Pasted: Nov 28, 2024, 8:36:18 am
Views: 9