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

Give a practical example of singleton class usage?

0 Answers  


how would you implement a thread pool? : Java thread

0 Answers  


Is main is a keyword?

0 Answers  


justify c is portable

1 Answers  


Program to print 1 1 2 1 2 3 1 2 3 4 like that

8 Answers   Huawei,


what is object slice?

0 Answers  


How is Object Oriented Programming different from Procedure Oriented Programming?

0 Answers   Amdocs,


Is special character in java?

0 Answers  


What is use of functional interface in java 8? Explain

0 Answers  


What is size of int in java?

0 Answers  


Can we extend a class with private constructor?

0 Answers  


What is mean by collections in java?

0 Answers  


Categories