Find the errors in the following code snippet and correct them: [2]
boolean true = a;
If(false)
System.Out.Println("Nothing in here")
else
System.out.println(Correct this mistake)
Answers
Answered by
5
in 1st line
if i should be small
2nd line
out o should be small and print p should be small
semicolon missing at the end
3rd line
Double quotes should be put right next to the brackets before C and after e
Answered by
5
Hey Buddy
Here's The Answer
__________________________________
In line
boolean true = a;
=> true is acting like a variable which isn't possible as true is a keyword and a Boolean variable can have false and true as its value.
CODE WITH CORRECTIONS
______________
boolean a = true;
if ( false ) {
System.out.println( "Nothing is here " );
} else {
System.out.println( " Correct this mistake " );
}
_______________
Hope It Helps
:)
Similar questions
Biology,
3 months ago
Social Sciences,
3 months ago
Chemistry,
3 months ago
Math,
6 months ago
English,
10 months ago