+ 1

Please someone should help me find the bug in this code so it will print those inputs.

public class Program { public static void main(String[] args) { //fix the variable types double name = "Toyota"; int engine = 4.7; String year = 2019; System.out.println("Name: " + name); System.out.println("Engine: " + engine); System.out.println("Year: " + year); } }

1st Feb 2022, 2:33 PM
Estherpraise Aiyeki
Estherpraise Aiyeki - avatar
10 Answers
+ 6
Estherpraise Aiyeki here is how you should have fixed the code. Next time don't copy paste the code in the description box, save the code in code playground and share it's link here just like i did https://code.sololearn.com/cA8zXS04C1td/?ref=app And ā€ƒā€ƒā€ƒā€ƒā€ƒā€ƒā€ƒā€ƒ[No Name] , @Estherpraise Aiyei didn't make the syntax error, it was the quiz and the task is to correct the data types.
1st Feb 2022, 3:13 PM
Rishi
Rishi - avatar
1st Feb 2022, 2:57 PM
Estherpraise Aiyeki
Estherpraise Aiyeki - avatar
+ 1
I did exactly this and it still didnā€™t work
1st Feb 2022, 2:52 PM
Estherpraise Aiyeki
Estherpraise Aiyeki - avatar
+ 1
Okay...i tried screenshoting it to send, but couldnā€™t and i have tried what you sent before and it did not work
1st Feb 2022, 3:03 PM
Estherpraise Aiyeki
Estherpraise Aiyeki - avatar
0
Its normal syntax error not the bug, Just replace your variable types with this String name = "Toyota" ; double engine = 4.7; int year = 2019;
1st Feb 2022, 9:21 PM
Chandan Maurya
Chandan Maurya - avatar
0
Do This Instead public class Program { public static void main(String[] args) { //fix the variable types String name = "Toyota"; double engine = 4.7; int year = 2019; System.out.println("Name: " + name); System.out.println("Engine: " + engine); System.out.println("Year: " + year); } }
1st Feb 2022, 9:47 PM
Enereba Philip G.
Enereba Philip G. - avatar
0
Thanks
2nd Feb 2022, 7:04 AM
Estherpraise Aiyeki
Estherpraise Aiyeki - avatar
0
šŸ‘ šŸ‘
2nd Feb 2022, 6:19 PM
Jahongir Normurotov 16 Years
0
public class Program { public static void main(String[] args) { //fix the variable types String name = "Toyota"; double engine = 4.7; int year = 2019; System.out.println("Name: " + name); System.out.println("Engine: " + engine); System.out.println("Year: " + year); } }
15th Nov 2022, 7:44 AM
Pooja Patel
Pooja Patel - avatar