What will this printint i=10000System.out.println(i*i);and explain why ?

I do't know

Showing Answers 1 - 19 of 19 Answers

Hema

  • Oct 10th, 2005
 

the answer is 100000000

  Was this answer useful?  Yes

venkatram reddy

  • Oct 26th, 2005
 

Hi.

 This shows that you are entered some question which is not at all relevent and a stupid question. Please don't mislead any people to these kind of questions which are not really useful.

 If you don't help, its okay. But if you harm I don't keep quite. So please don't enter these kind of stupid questions into this kind of great Knowledge base site.

 Hope now you understood the answer.

Sonali Pande

  • Oct 27th, 2005
 

If we write program as...class First{public static void main(String s[]){ int i=10000System.out.println(i*i);}}It will show an error.....';' expected....after 10000

  Was this answer useful?  Yes

chaitanya

  • Oct 28th, 2005
 

The Output for the statement will be some garbage value

b.caz int can handle maximum value of 35,535  so i*i will exceed the maximum limit

  Was this answer useful?  Yes

Amitava Pal

  • Nov 3rd, 2005
 

The result would be 100000000 because, the size of the Data Type "int" in java is 2^32.

Harish

  • Nov 3rd, 2005
 

It will print 

100000000

Just it is printing the product value that is i*i,100000000 because i value is 10000.

  Was this answer useful?  Yes

Rajit Keskar

  • Mar 24th, 2006
 

The answer to this is simple. "int" has restriction of35,265 or somethin likethat.Beyond that it cant store any values.It will show an error like like "Out of bounds

  Was this answer useful?  Yes

manjunath N

  • May 2nd, 2006
 

It wil surely print 100000000.

  Was this answer useful?  Yes

prem kumar

  • Jul 29th, 2006
 

HI

This will give you compile time error

; missing in line 1

Thx

Premmm

  Was this answer useful?  Yes

amit saini

  • Jan 9th, 2007
 

That code will give compile time error ,because u haven't give semicolon after initialization of i
you give i=10000
u should give it
 i=10000;
got it

amit saini

  Was this answer useful?  Yes

vasu.funky

  • Oct 7th, 2007
 


It will give you the multiplied value..does not throw an error..we are no way storing this result (i mean you are not storing thisvalue in any interger or so...) it is just displayed in the sop which expects a string value

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions