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...


int a=1,b=10;
System.out.println(a+b--);

Answers were Sorted based on User's Feedback



int a=1,b=10; System.out.println(a+b--);..

Answer / jayaprakash

11

Is This Answer Correct ?    65 Yes 5 No

int a=1,b=10; System.out.println(a+b--);..

Answer / shahsidhar

11

because b-- having post decrement operator that means
decrement operation will be done in the next statement i.e
after a+b-- statement execution.

Is This Answer Correct ?    22 Yes 2 No

int a=1,b=10; System.out.println(a+b--);..

Answer / ramakrishna

Ans: 11

Is This Answer Correct ?    10 Yes 1 No

int a=1,b=10; System.out.println(a+b--);..

Answer / muthu krishna manian

11

Is This Answer Correct ?    4 Yes 0 No

int a=1,b=10; System.out.println(a+b--);..

Answer / abc

11

Is This Answer Correct ?    4 Yes 0 No

int a=1,b=10; System.out.println(a+b--);..

Answer / ravi ranjan

ANSWER=11

Is This Answer Correct ?    3 Yes 1 No

int a=1,b=10; System.out.println(a+b--);..

Answer / mamitha

Ans.11 b'coz based on operator precedence rule, -- ll works first and we get 10 for b (post decrement) and it ll add with 1 .

Is This Answer Correct ?    1 Yes 0 No

int a=1,b=10; System.out.println(a+b--);..

Answer / bikash

can u pls explain how ur answers are 11 and 1 11?

Is This Answer Correct ?    3 Yes 3 No

int a=1,b=10; System.out.println(a+b--);..

Answer / amit

U see 'a' and 'b' are integer type so they will be added.
if it had been char then the answer would be 111.

Is This Answer Correct ?    0 Yes 0 No

int a=1,b=10; System.out.println(a+b--);..

Answer / amit

@Nagesh
if we have:(a+(b--));
answer:11

if : ((a+b)--);
answer: 11;

if :(a+b--);
answer:11;

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is a layout manager and what are different types of layout managers available in java awt?

0 Answers  


What is singleton math?

0 Answers  


What's the default access specifier for variables and methods of a class?

0 Answers  


How do you read a char in java?

0 Answers  


What is r in java?

0 Answers  


How to create an immutable class?

0 Answers  


What is rule of accessibility in java?

0 Answers  


What is the constructor?

0 Answers  


Can we write multiple catch blocks under single try block?

0 Answers  


What are anonymous inner classes?

0 Answers  


Is static variable stored in heap?

0 Answers  


What is the benefit of inner classes in java?

0 Answers  


Categories