• Register
Welcome to Kodlogs, programming questions and answer website.
0 votes
10 views

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)  

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:

http://docs.oracle.com/javase/tutorial/java/package/usepkgs.html

by (21.9k points)  
edited by
...