Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


long d =10;int i =0;i=d; /// is this possible? If d is very
long number (10 digits or some thing) then?

Answers were Sorted based on User's Feedback



long d =10;int i =0;i=d; /// is this possible? If d is very long number (10 digits or some thing) ..

Answer / vicks

this is possible by using Type Casting, But there is an
exception occure "LostOfPressesions". because "Long" having
64bit (8 Bytes) of memory bolck, on the other hand "int"
having only 32bit (4 Bytes) of memory. which is less then
long. there is a case to lost some amount of data.

Is This Answer Correct ?    4 Yes 0 No

long d =10;int i =0;i=d; /// is this possible? If d is very long number (10 digits or some thing) ..

Answer / chaitanyaelluru

Yes,It is possibel through casting.

Is This Answer Correct ?    1 Yes 1 No

long d =10;int i =0;i=d; /// is this possible? If d is very long number (10 digits or some thing) ..

Answer / vijayakumar chinnasamy

It display compile time error. Cant convert form long to
int. becacuse it -2 32 bit and long is 64bit, so u need to
type case the long value into int value.

Is This Answer Correct ?    1 Yes 2 No

Post New Answer



More Core Java Interview Questions

If I have 1000 objects and my requirement is to sort them quickly, then which collection would you recommend and why?

5 Answers   KPIT,


What is the life-cycle of an object?

2 Answers   Broadridge, Syntel,


Why should I use abstract class?

0 Answers  


What is += mean in java?

0 Answers  


What does a boolean method return?

0 Answers  






What is classes in java?

0 Answers  


What is a list in java?

0 Answers  


What is multithreading in java?

0 Answers  


Name the method that used to clear the buffer ?

2 Answers  


What is the default value of byte datatype in java?

0 Answers  


What is bufferedreader in java?

0 Answers  


What is java util list?

0 Answers  






Categories