Im trying to copy a Method example from my book, but it does not give me the entire code. I know that my 5th line is wrong, but I don't know how to fix it.
import java.util.Scanner;
public class method {
public static main(String [] args) {
int sum = 0;
for (int i = 1; i <= 10; i++)
sum += i;
System.out.println("Sum from 1 to 10 is " + sum);
return sum;
}
}