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;
}
}
Answer Posted / 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 |
Post New Answer View All Answers
Why are constructors used?
What is the purpose of the return statement?
What do you mean by compiler?
Which collection does not allow duplicates in java?
Can a abstract class be defined without any abstract methods?
Does java allow default arguments?
What is linked hashmap and its features?
What is the difference between the prefix and postfix forms of the ++ operator?
What are scalar data types?
How do you bind variables?
What is a qms manual?
How can you read content from file in java?
What is the difference between serializable and externalizable interface?
What is the symbol for space?
Which eclipse is best for java?