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


what is the output???????

public class multireturn
{
public(int assign x ( int x)
{
if(4==x)
{
return 7;
}
else if (7=x+3)
{
return 6;
}
return 5;
}
}

Answers were Sorted based on User's Feedback



what is the output??????? public class multireturn { public(int assign x ( int x) { if..

Answer / pranali bhise

It will result in Compile time error due to 3 reasons
1) The parenthesis '(' after public is not allowed.
2) The space between "assign" and "x" is not allowed
3) 7 = x + 3 is not allowed as a variable is needed on the
left hand side of the assignment operator.

Is This Answer Correct ?    15 Yes 0 No

what is the output??????? public class multireturn { public(int assign x ( int x) { if..

Answer / amit singh

answer is that compile time error
because what you did i don't know what i saw i know
else if(7=x+3)
it not a condition you are using the assignment operator
in place of (7==x+3)
amitsing2008@gmail.com

Is This Answer Correct ?    7 Yes 0 No

what is the output??????? public class multireturn { public(int assign x ( int x) { if..

Answer / guest

7 or 5 depending on value of x but never 6

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

Why java is a platform independent? Explain

0 Answers  


Are arrays immutable in java?

0 Answers  


what is the difference between Object Based Language and Object Oriented Language?

0 Answers   Aspire,


Instead of writing Home, Remote Interfaces if i directly extends EJBObject to bean class what happens?

1 Answers   Flextronics,


What is the relationship between class and object?

0 Answers  


Explain about vector, dictionary,hash table, property classes?

1 Answers   Patni,


What's the access scope of protected access specifier?

0 Answers  


What is the do while loop syntax?

0 Answers  


What is the abstract class?

0 Answers  


What is the final access modifier in java?

0 Answers  


What is += mean in java?

0 Answers  


What is the purpose of checked and unchecked exceptions in JAVA?

0 Answers   Amdocs,


Categories