I am facing issues importing classes and setting variables. I am testing out a program that just simply outputs what your input was and puts a time stamp.
Here is my code:
class Test {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
Message messageObject = new Message ();
Time timeObject = new Time ();
System.out.println("Enter your message here: ");
String message = input.nextLine();
messageObject.simpleMessage(message);
timeObject.getTime();
}
void simpleMessage(String message) {
System.out.println(message + time);
}
}
This is the error that occurred :
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Message cannot be resolved to a type
Message cannot be resolved to a type
The constructor Time() is undefined
at Test.main(Test.java:8)
Can someone help me with this?