• Register
0 votes
139 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:

6 5 3
6,930 points

Please log in or register to answer this question.

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

9 7 4
38,600 points

Related questions

0 votes
1 answer 13 views
13 views
Problem : why this happened with me ? Getting Java Exception in thread "main" java.lang.error: unresolved compilation problem:.
asked Mar 6 Wafa Abu Yousef 6.1k points
0 votes
2 answers 3K views
3K views
Problem : I am having a trouble while importing classes and setting variables and also I need help with my test program which I am doing. I want to test a program that simply outputs what the input was and puts the time stamp ( like Skype does ). I am having ... Message cannot be resolved to a type Message cannot be resolved to a type The constructor Time() is undefined at MyTest.main(Test.java:8)
asked Jan 28, 2020 jwilliam 3.9k points
0 votes
1 answer 4 views
4 views
Problem: Anyone know about this then please answer me. I really suffered from this problem in my pc. Anyone help me out?
asked Apr 3 niyatiry 3.2k points
0 votes
2 answers 4 views
4 views
Problem: Can anyone help me out? I have no idea what I have to do on this, anyone know then please answer me.
asked Apr 1 niyatiry 3.2k points
0 votes
0 answers 39 views
39 views
my program (java) is below. I wrote it with eclipse IDE. I still can&rsquo;t figure out the mistake. package com.in28minutes.firstjavaproject; public class MultiplicationTable { void print() { for (int i = 1; i <= 10; i++) { System. ... public class MultiplicationTableRunner { public static void main(String[] args) { MultiplicationTable instance = new MultiplicationTable(); instance.print(); } }
asked Feb 6 chathura2001 120 points
0 votes
1 answer 43 views
43 views
I am having a problem importing classes and setting variables and I need help with a test program I am doing.
asked Jan 23 TeamScript 13.5k points
1 vote
1 answer 150 views
150 views
Problem: I am a begginer in java programming language and I have been coding for just some days. To practice my programming I wrote this code in java: public class Main { public static void main(String[] argv){ int 2count, h-l, a/b, } } But It shows me the error message ... , . expected Syntax error on token ",", ;expected at Main.main(Main.java:3) Whats is wrong in my code can anyone help me out?
asked Apr 6, 2020 LizzyM 6.1k points
0 votes
1 answer 7 views
7 views
Problem: This is a feature of NoSuchMethodError in Java and complains about "main" which is the name of the method that JVM tries to connect to but doesn't find in the wrong class. java.lang.NoSuchMethodError
asked Feb 7 ahmedadel9090 3.1k points
0 votes
1 answer 48 views
48 views
explain with an example?
asked Nov 18, 2020 jagruthi 680 points
1 vote
1 answer 56 views
56 views
Problem: I got error while applying weblogic patch useing bsu.sh: patch_download_dir=$FMW_HOME/utils/bsu/cache_dir -patchlist=GFWX -prod_dir=$FMW_HOME/wlserver_10.3 -log=$FMW_HOME/utils/bsu/bsu_weblogic.log Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded ... .bea.plateng.patch.Patch.main(Patch.java:281) Can anyone explain me this and help me to solve this error?
asked Mar 27, 2020 LizzyM 6.1k points