task - error making / finding
public class Home{
public static void main(string args[]){
System.out.println("hello");
}
}
output:
Home.java:3: error: cannot find symbol
public static void main(string args[]){
^
symbol: class string
location: class Home
public class Home{
public static void main( String args[]){
system.out.println("hello");
}
}
output:
Home.java:4: error: package system does not exist
system.out.println("hello");
^
1 error
error: compilation failed
public class Home{
public static main( String args[]){
System.out.println("hello");
}
}
output:
Home.java:3: error: invalid method declaration; return type required
public static main( String args[]){
^
1 error
error: compilation failed
public class Home{
public static void ( String args[]){
System.out.println("hello");
}
}
output:
Home.java:3: error: expected
public static void ( String args[]){
^
1 error
error: compilation failed
public Home{
public static void main( String args[]){
System.out.println("hello");
}
}
output:
Home.java:1: error: class, interface, annotation type, enum, record, method or field expected
public Home{
^
Home.java:6: error: class, interface, annotation type, enum, record, method or field expected
}
^
2 errors
error: compilation failed
public class {
public static void main( String args[]){
System.out.println("hello");
}
}
output:
Home.java:1: error: expected
public class {
^
1 error
error: compilation failed
public class Home{
public static void main( String args){
System.out.println("hello");
}
}
output:
error: can't find main(String[]) or main() method in class: Home
public class Home{
public static void main( String args[){
System.out.println("hello");
}
}
output:
Home.java:3: error: ']' expected
public static void main( String args[){
^
1 error
error: compilation failed
public class Home{
public static void main( String []){
System.out.println("hello");
}
}
output:
Home.java:3: error: expected
public static void main( String []){
^
1 error
error: compilation failed
public class Home{
public static void main( String args[]{
System.out.println("hello");
}
}
output:
Home.java:3: error: ',', ')', or '[' expected
public static void main( String args[]{
^
1 error
error: compilation failed
public class Home{
public static void main( String args[]){
System.println("hello");
}
}
output:
Home.java:4: error: cannot find symbol
System.println("hello");
^
symbol: method println(String)
location: class System
1 error
error: compilation failed
public class Home{
public static void main( String args[]){
System.OUT.println("hello");
}
}
output:
Home.java:4: error: cannot find symbol
System.OUT.println("hello");
^
symbol: variable OUT
location: class System
1 error
error: compilation failed
public class Home{
public static void main( String args[]){
System.out.println("hello");
}
output:
Home.java:5: error: reached end of file while parsing
}
^
1 error
error: compilation failed
Top comments (0)