logo blog

contoh script java class Casting

class Casting{
public static void main(String args[]){
int x=10, y=3;

double hasil =x/y;
System.out.println("Tanpa casting: "+x+" / "+y+" = "+hasil);

hasil = (double) x/y;
System.out.println("Dengan casting: "+x+" / "+y+" = "+hasil);
}
}



Artikel Terbaru :

Related Post:

Copyright © 2016. puzzpa - All Rights Reserved | Template Created by Kompi Ajaib Proudly powered by Blogger