DEV Community

Keerthiga P
Keerthiga P

Posted on

Debugging in Java

❌ Error 1: Semicolon after Class

public class Home;
{
    public static void main(String[] args) {
        System.out.println("Hello World");
    }
}
Enter fullscreen mode Exit fullscreen mode

❌ Error 2: Wrong { Position

public class Home;
{
    public static void main(String[] args) {
        System.out.println("Hello World");
    }
}
Enter fullscreen mode Exit fullscreen mode

❌ Error 3: string instead of String

public class Home {
    public static void main(string[] args) {
        System.out.println("Hello World");
    }
}
Enter fullscreen mode Exit fullscreen mode

❌ Error 4: Wrong Array Syntax

public class Home {
    public static void main(String() args) {
        System.out.println("Hello World");
    }
}
Enter fullscreen mode Exit fullscreen mode

❌ Error 5: Semicolon after main

public class Home {
    public static void main(String[] args);
    {
        System.out.println("Hello World");
    }
}
Enter fullscreen mode Exit fullscreen mode

❌ Error 6: System.Out

public class Home {
    public static void main(String[] args) {
        System.Out.println("Hello World");
    }
}
Enter fullscreen mode Exit fullscreen mode

❌ Error 7: PrintLn

public class Home {
    public static void main(String[] args) {
        System.out.PrintLn("Hello World");
    }
}
Enter fullscreen mode Exit fullscreen mode

❌ Error 8: Missing Quotes

public class Home {
    public static void main(String[] args) {
        System.out.println("Hello World);
    }
}
Enter fullscreen mode Exit fullscreen mode

❌ Error 9: Missing Semicolon

public class Home {
    public static void main(String[] args) {
        System.out.println("Hello World")
    }
}
Enter fullscreen mode Exit fullscreen mode

❌ Error 10: Missing }

public class Home {
    public static void main(String[] args) {
        System.out.println("Hello World");
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)