Ask your own question, for FREE!
Computer Science 22 Online
OpenStudy (anonymous):

Java, netbeans. Why does the following code get an output of 3.0? int a = 32, b = 10; double c = a/b; System.out.println( "The value of c is " + c ); I know that double treats values as integers, yes? So if I did: double a = 32, b = 10; double c = a/b; System.out.println("The value of c is" + c); I guess I'd just like clarification between the types of data int and double handle.

OpenStudy (e.mccormick):

a and b are ints. What is integer division in Java? 32/10= ?? vs 32.0/10.0= ??

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!