I am trying to create a multiple class program and its coming up with errors this is the code
First Class Named Test1
This Class is coming up with errors Its Saying "Syntax error on token "message", VariableDeclarator expected after this token"
import java.util.Scanner; public class Test1 { public static void main(String[] args){ System.out.println("Welcome User My Name Is JARVIS "); Scanner input = new Scanner(System.in); // This Is The Input Command Line System.out.print("Enter Username: "); // This Is Where Users Enter Their Username String line = input.nextLine(); // This Command Puts The Entered Username onto the next line System.out.println("Welcome User " + line); // This Combines The Welcome User With The Inputed Text:) } Test2 Test2Object = new Test2(); Test2Object.message;
Second Class Named Test2
Please Helppublic class Test2 { public void message(){ System.out.println("This is Test2 Class"); } }