不确定标题是否有意义,但我试图从接收linkedhashmap的类返回成功消息,但是当我尝试编译文件时,eclipse给了我错误,提供
Remove arguments to match 'logFile()'
Create constructor 'logFile(Map<String, String>)'
如何设置它来发送Map
和接收一个String
?谢谢艺术
根据下面的@Jeff Storey 更正了代码,并针对 Eclipse 进行了错误抑制
调用类
eventLog.put(stringA,stringB);
logFile logStuff = new logFile();
successRtn = logFile.Process(eventLog);
// Do Stuff with SuccessRtn
日志文件类
public class logFile {
static String Success = "Fail";
public static String Process(Map<String, String> eventlog){
// Do Stuff
Success = "Yeh!"
return Success;
}
public static void main(String[] args){
@SuppressWarnings("static-access")
String result = new logFile().Procces(eventLog);
System.out.println("result = " + result);
}