Home / MCQ Bank / Computer
Computer Data Types And Variables

What will be the output of the following Java code snippet? double a = 0.02; double b = 0.03; double c = b - a; System.out.println(c); BigDecimal _a = new BigDecimal("0.02"); BigDecimal _b = new BigDecimal("0.03"); BigDecimal _c = b.subtract(_a); System.out.println(_c);

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option A • 0.009999999999999998 0.01

Related Computer Questions

Which of the following is not associated with web socket communication? Vertex covering can be a good approach to which type of the problems? What is the stored in the object obj in following lines of Java code? box obj; Methods of a class that provide access to private members of the class are called as ______ and ______ Operating system is like a______?