Java Interview Question: What will be the output when you divide a number by zero?

preview_player
Показать описание
In this video, I have explained one tricky java interview question: What will be the output when you divide a number by zero?

~~~Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:

Follow me on my Facebook Page:

Let's join our Automation community for some amazing knowledge sharing and group discussion on Telegram:

Naveen AutomationLabs Paid Courses:
Java & Selenium:

Java & API +POSTMAN + RestAssured + HttpClient:
Рекомендации по теме
Комментарии
Автор

Just to add: There is a concept of negative infinity as well in Double class. e.g.:
double d = -5.0 / 0.0; System.out.println(d); It will print "-Infinity".
Thanks Naveen for the video.

pramodkajla
Автор

Cool Naveen never tried this and Very nice trick.

Mukeshotwani
Автор

Thanks a lot for this kind of interview questions making video and expecting more more videos in future without single video in a day can't getting sleep. All the best

maheshz
Автор

Output as Infinity??🧐
Learnt a new thing
Thank you from Nepal🇳🇵

sureshupreti
Автор

Excellent series. Very helpful. Thanks for uploading

prashantj
Автор

Naveen sir thanks for the clarification. Swapping of two numbers without a third variable a=(a+b)-(b=a). I tried this solution for swapping.

venkateshsivadurga
Автор

Thank you Navin. I learnt new tricky question today.

kavishautomationfactory
Автор

No one except you will have explained it

adhage
Автор

I thought infinite could come for all type of numbers by 0 before I see this video but it's not for integer, thin line of difference u explaied it great.

pavankumar-xbnw
Автор

Very tricky question Naveen! Thanks for covering it!

riddhishah
Автор

Thank you Naveen. Useful for me
If possible daily upload one video like this Naveen 👍

vinith
Автор

Thanks, I have learned lot of new concepts on Java from your videos.

HameedKhan-mqve
Автор

This is bcoz it has implemented Floating Point Arithmetic Algorithm which specifies special values like 'NaN' (not a number) and 'infinity' .. For divide by zero cases... as per IEEE 754 standards..

shoaibjack
Автор

Output 1 ->if dividend is double it will give Arithmetic Exception
Output 2->it will give Arithmetic exception

himanshupokhriyal
Автор

Thanks sir respect from South Africa 🇿🇦 I am working here but sometime this information is helpful when I have to look for a change

DiptiJoshirjdj
Автор

Thanks, Sir
Can u help me, how to find duplicate elements if our array has multiple duplicate elements?

backpackcouple
Автор

your video's are enough for freshers?

muralimohanreddy
Автор

Thank You, Never thought infinity as an output.. good to know for interviews

hackwithharsha
Автор

Naveen sir thank you so much. I want to get into automation testing. Can I start with your videos?

ananyachatterjee
Автор

I always thought NaN is short for 'Not a Number'

abhay