---
title: "How Autoboxing is going here?"  
description: "How Autoboxing is going here?"  
author: "Anonymous User"  
published: 2015-04-28  
updated: 2015-04-28  
canonical: https://www.mindstick.com/forum/23152/how-autoboxing-is-going-here  
category: "java"  
tags: ["java"]  
reading_time: 1 minute  

---

# How Autoboxing is going here?

Hi there \
**This is my [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii)** \

```
public class Autoboxing {              public static void main(String[] args) {                double x2 = 0.0/0.0, y2 = 0.0/0.0;            Double a2 = x2, b2 = y2;            StdOut.println(x2 == y2);            StdOut.println(!a2.equals(b2));    }} 
```

\
\
**its [Output](https://www.mindstick.com/interview/34427/explain-the-output-in-angular) is :**false false \
I am expecting [true](https://yourviews.mindstick.com/view/81326/boycott-chinese-products-dream-will-come-true) false

## Replies

### Reply by Anonymous User

I think it's something to do with the special value which you get when you divide zero by zero as double values\
Because there are two different flavours of NAN, Double.POSITIVE_INFINITY and Double.NEGATIVE_INFINITY You can’t directly compare == Double.NAN to check for NAN. However, you can directly compare == Double.NAN; However, you can use Double.isNaN or == to compare with Double.POSITIVE_INFINITY.


---

Original Source: https://www.mindstick.com/forum/23152/how-autoboxing-is-going-here

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
