Mailinglist Archive: opensuse (4393 mails)

< Previous Next >
Java error
Hello everyone,

I hope this is rather simple, but I am getting a strange error in code. I have two classes, one calls the other to return a string. It is very simple code:

public class returnList
{
public String[] returnList()
{
String lStr = "hello";
String [] lRetStr = new String[1];
lRetStr[0] = lStr;
return lRetStr;
}

}


AND

//import java.sql.*;
//import org.gjt.mm.mysql.*;

public class test_db
{
public static void main(String[] Args)
{
returnList lList = new returnList();
String lStr[] = lList.returnList();
System.out.println(lStr[0]);
}
}

When I - javac returnList.java
it compiles just fine.

When I - javac test_db.java

I get:
test_db.java:8:cannot resolve symbol
symbol : class returnList
Loction : class test_db
returnList lList = new returnList();
^

This code compiles just fine in Windows. I assume that I am missing a library or that I have not installed a package.

Can anyone give me a hand with this?

Thanks for your help,

Jim




< Previous Next >
Follow Ups