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
What is polymorphism in java? What are the kinds of polymorphism?
Explain different ways of creating a thread. Which one would you prefer and why?
What is field name?
What are adapter classes?
What is the difference between preemptive scheduling and time slicing in java programming?
Do I need to import java.lang package any time? Why?
What is skeleton and stub? What is the purpose of those?
How does singleton class work?
What are the different conditional statements?
How can you set an applet’s height and width as a percentage?
List some important characteristics on jre
How does predicate work in java?
How do you compare two strings lexicographically?
How to check if linked list contains loop in java?
What is the SimpleTimeZone class?