Saturday, May 11, 2019

What do you think the output will be for the following code?

Problem statement:
Can you let me know the output of the following code?
  1. public class ExecutionOne {
  2.     public static void main(String[] args) {
  3.         double d1 = 0.8;
  4.         double d2 = 0.8;
  5.         System.out.println(d1 == d2);
  6.         Double d3 = 0.8;
  7.         Double d4 = 0.8;
  8.         System.out.println(d3 == d4);
  9.     }
  10. }
Output:
true
false

No comments:

Post a Comment

Blueprint for self-improvement

To learn faster: Make the process fun To understand yourself : Write To understand the world better : Read To build deeper connection : Lis...