0

How can I solve this?

public class Program { public static void main(String[] args) { //declare variables String name = "Howard"; /* declare the age int age = 42; */ //output values //System.out.println(name+" is "+age+" years old."); } }

22nd Feb 2023, 3:16 PM
SEvan
SEvan - avatar
2 Answers
+ 5
What you need to solve there? Do you aware of it? I guess you need to execute output statement...! There 3 statements String declaration, then integer declaration with assignments, next a output statement which displays name with age are given but last 2 valid statements are commented so those won't get executed. You need to uncomment those required statements and see output.. /* .. */ Is multiline comment // is a single line comment. statements commented won't get executed...
22nd Feb 2023, 3:23 PM
Jayakrishna 🇼🇳
0
Code well be like this //declare the age int age = 42; //output values System.out.println("name is " +name+" " +age+" years old."); } }
24th Feb 2023, 11:30 AM
Reem Yahia Ahmad Hassan
Reem Yahia Ahmad Hassan - avatar