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

what is class/object diagram

3 Answers   Zycus Infotech,


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

0 Answers  


what is difference between struts1.2 and struts2.0

1 Answers  


Q1. A. Write note on "The class path Environment Variable". B. Which are different kinds of source code? Q2. A. How to create an interface? B. Why convert an applet to an application? Q3. A. How to use Media tracker Class. B. How to use string tokenizer class. Q4. A. Explain the overview of UDP messaging. B. Difference between SQL Exception class and SQL Warning class. Q5. A. How to create com object in Java? B. Write short notes on "The properties class" Q6. A. When object is created and destroyed? B. Explain the JDB in depth & command line. C. Write short notes on Web Sites.

1 Answers  


Runining mutiple tomcat server in a single machine is possible Yuo wil have to duplicate configuration with different port numbers

2 Answers   HCL,






How to call the m1() method of Base class in below snippet ? class Base { public void m1() { System.out.println("Base m1 "); } public void m2() { System.out.println("Base m1 "); } } ====================== class Derived extends Base { public void m1() { System.out.println("Derived m1"); } public void m3() { System.out.println("Derived m3"); } public static void main(String[] args) { Base ob=new Derived(); ob.m1(); //System.out.println("Hello World!"+ob.m1()); } }

6 Answers   Cap Gemini, TCS,


when exactly should we use throws ,and wen exactly should we use the try and catch for exceptional handling

0 Answers  


How do I find jre path in windows?

0 Answers  


httt method

2 Answers   HCL,


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

0 Answers  


What are the uses of the set interfaces in the java collections? : java collections

0 Answers  


Which is the better framework for web applications, struts or spring, and why?

1 Answers   IBM, TATA,


Categories