java program using int and double

前端 未结 7 861
礼貌的吻别
礼貌的吻别 2020-12-21 00:16

I have written a simple Java program as shown here:

public class Test {

    public static void main(String[] args) {
        int i1 =2;
        int i2=5;
           


        
相关标签:
7条回答
  • 2020-12-21 00:51

    This link provides information about data type conversion, both implicit and explicit type.

    To provide exact answer to the question will be :

    double d = 3 + (double)i1/i2 + 2
    
    0 讨论(0)
提交回复
热议问题