Which of the following declaration is wrong?
int i=45;
float j = 45.0;
double k=45.0;

Answers were Sorted based on User's Feedback



Which of the following declaration is wrong? int i=45; float j = 45.0; double k=45.0;..

Answer / shukla.swapnil

float j = 45.0; <=== this declaration is wrong

Is This Answer Correct ?    24 Yes 5 No

Which of the following declaration is wrong? int i=45; float j = 45.0; double k=45.0;..

Answer / azad bajaj

Correct way to declare is
floar j= 45.0f;

Is This Answer Correct ?    19 Yes 4 No

Which of the following declaration is wrong? int i=45; float j = 45.0; double k=45.0;..

Answer / pranav

float j = 45.0; <- This statement is wrong

Correct way is:

float j = 45.0f;

Is This Answer Correct ?    12 Yes 1 No

Which of the following declaration is wrong? int i=45; float j = 45.0; double k=45.0;..

Answer / mohit

he is right.....

Is This Answer Correct ?    4 Yes 1 No

Which of the following declaration is wrong? int i=45; float j = 45.0; double k=45.0;..

Answer / rohit

by default it takes double.So we need to explicitly mention it as float

Is This Answer Correct ?    4 Yes 2 No

Post New Answer

More Java J2EE AllOther Interview Questions

Which sorting algorithm is used by collections.sort() in java ?

0 Answers  


What is difference between Application Server and Web Server?

1 Answers   Logica CMG, SCS,


What is java collection? : java collections

0 Answers  


What is the use of hashcode in java ?

0 Answers  


Why do you use Context Object

2 Answers   HCL,






What is IOC in spring?

10 Answers   Centris,


what is jndi?

2 Answers  


Which interface does java.util.hashtable implement?

0 Answers  


whats the relation ship between LDAP and JNDI?

1 Answers  


What is the use of the list interface in the java collection? : java collections

0 Answers  


How is hashset maintained in memory by java ?

0 Answers  


Should we create system software ( e.g operating system ) in java ?

0 Answers  


Categories