Re: simple java calculation

I assume k and j are ints.

What is the result of any int divided by a larger int?

Re: simple java calculation

int / int = int

100:10 = 10 and not 0. This is the way I get it. Could you please clarify what do you exactly mean?

Re: simple java calculation

An int divided by a larger int, as in:

int k = 10 / 100;

What will k be?

Re: simple java calculation

ohhh..right..now I got it. How stupid..it will be 0. It will be 10: 100 and not 100:10.

How about expressions like

m = j++ + k. Can you tell me what will be the precedence order and the result given that m = 10, j=3 and k=2

Re: simple java calculation

So that you know how to find these things yourself, try searching for 'java precedence' with your favorite search engine. The top 2 results I got from Google are both excellent.