Programmers learn & share
0 votes

Problem :

I am having a problem importing classes and setting variables and I need help with it.
I am getting below error

exception in thread "main" java.lang.error: unresolved compilation problem:

by (6.9k points)   | 45 views

1 Answer

0 votes

Solution :

This line is the root cause of your problem: Message messageObject = new Message ();

The error says that Message class is not known at compile time.

So you need to import below classes to resolve the issue.

import package1.package2.Message;

import java.util.Scanner; 

import java.util.Timer;

Further Readings:

by (36.1k points)  
edited by
2,187 questions
2,514 answers
241 users