Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with compile / creating objects

Status
Not open for further replies.

pdotd

Programmer
Jun 15, 2004
29
CA
hey there,
i have problem with creating an objects from other classes.

for instance:

i have a greeter class;

public class Greeter
{
public String SayHello()
{
String message = "Hello World!";
return message;
}
}
and now if i try to create a Greeter object in my GreeterTest class


public class GreeterTest
{
public static void main(String[] args)
{
Greeter worldGreeter = new Greeter();
System.out.println(worldGreeter.SayHello());
}
}

i get 2 compiler errors:

GreeterTest.java:5: cannot resolve symbol
symbol : class Greeter
location: class GreeterTest
Greeter worldGreeter = new Greeter();
^
GreeterTest.java:5: cannot resolve symbol
symbol : class Greeter
location: class GreeterTest
Greeter worldGreeter = new Greeter();
^
2 errors

now i can compile the Greeter class just fine or even if i import other jdk classes....but it instances like this it won't compile

 
i will indeed, thanks for the link, everything works now.

pdotd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top