A Developer Gateway To IT World...

Techie Uncle Software Testing Core Java Java Spring C Programming Operating System HTML 5 Java 8 ES6 Project

Write a program to TypeCast data types in java

public class TypeCast{

     public static void main(String []args){
        int a=10; int b=3;
        int k=a/b;
        System.out.println(k);//output 3
        float d=(float)a/b;
        System.out.println(d);//output:3.3333333
     }
}




LEARN TUTORIALS

.

.