Giving error due to code is correct in java intermediate

import java.io.*;
public class Introduction {
public static void main(String args) {
String name =“Amandeep Singh”;
String hobbies = “Coding”;
int age = 21;

}
}
Task
Before we can print our variables, we need variables to print! In the code editor declare the following variables:

  • a String name that’s set to your name
  • a String hobbies that contains a list of your hobbies
  • an int age that contains your age
    //task is givng error set the name ,String name = “Amandeep Singh”; is correct syntax

Probably just the SCT being very picky (using pattern matching), and expecting a space between the = and your string literal.

1 Like