Write a Java program to display the lamp is no if its true or the light is off. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

Write a Java program to display the lamp is no if its true or the light is off.

20th Jun 2022, 6:04 PM
Milad Ahmed
4 Answers
+ 1
Do you have any knowledge for the Java language? Show your attempt. Create a variable with a name. Give it a value for on. Create a if statement with the condition for on. if true it should output the the lamp is on. Create and else statement and print the lamp is off. Here is some info for If...else statements. https://www.w3schools.com/java/java_conditions.asp
20th Jun 2022, 7:01 PM
Chris Coder
Chris Coder - avatar
0
I don't want to. But if you need help doing so, show some code so you can get proper help.
20th Jun 2022, 6:19 PM
Justice
Justice - avatar
0
"the lamp is no if its true"? What do you mean? If you need help, please show what you have tried so far. If you need to revise the basics before doing the task, have a look at the sololearn Java course.
20th Jun 2022, 6:20 PM
Lisa
Lisa - avatar
0
//"lamp is no" "lamp is on"
20th Jun 2022, 11:18 PM
zemiak