Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

I want to persist data of objects for later use. What’s the best approach to do so?

0 Answers  


Java is based on pass by reference or pass by value ..

6 Answers   L&T, Wipro,


Why do people says “java is robust”?

0 Answers  


What is the default execution method in java?

0 Answers  


how can you retrive information from database by using hashmap/arraylist ,plz explain with example briefly?

1 Answers   Satyam,


What happens if a try-catch-finally statement does not have a catch clause to handle an exception that is thrown within the body of the try statement?

0 Answers  


Is string a data type in java?

0 Answers  


How the interruptible method gets implemented?

0 Answers  


What is the purpose of the File class?

3 Answers  


What are daemon Threads in java?

0 Answers   Impetus,


Write a java program to count the number of words present in a string?

0 Answers  


How can you make sure that your singleton class will always return single instance in multi-threaded environment?

0 Answers  


Categories