0

Some one help me with this code . They said there's a problem with the second line of code

package demoproject; public class myclass{ public static void main(String[] args) { // you are welcome to java System.out.println("hello to the world"); String name = ("Richard Afful"); int age = (23); double height = (153.34); System.out.println("name"); System.out.println("age"); System.out.println("height"); } }

26th Feb 2022, 1:33 AM
Richard Afful Manu
5 Answers
0
Where is my fault coming from and how can I solve that
26th Feb 2022, 1:48 AM
Richard Afful Manu
0
**Commented out line 1** //package demoproject; public class myclass{ public static void main(String[] args) { // you are welcome to java System.out.println("Hello to the world!"); String name = "Richard Afful"; ** () around the variable data is not necessary ** int age = 23; double height = 153.34; System.out.println(name); ** "name" will print name ... name without "" will print the variable data. System.out.println(age); System.out.println(height); } }
26th Feb 2022, 1:52 AM
William Owens
William Owens - avatar
0
So how should the code look like
26th Feb 2022, 1:58 AM
Richard Afful Manu
0
public class myclass{ public static void main(String[] args) { System.out.println("Hello to the world!"); String name = "Richard Afful"; int age = 23; double height = 153.34; System.out.println(name); System.out.println(age); System.out.println(height); } }
26th Feb 2022, 1:59 AM
William Owens
William Owens - avatar
0
thanks much
26th Feb 2022, 2:08 AM
Richard Afful Manu