我目前包含以下无法编译的代码.该else if声明报告说' ;' expected.我不明白为什么我不能使用else if这种情况?
public class FileConfiguration {
private String checkOs() {
String path = "";
if (System.getProperty("os.name").startsWith("Windows")) {
// includes: Windows 2000, Windows 95, Windows 98, Windows NT, Windows Vista, Windows XP
path = "C://Users//...";
}
elseif (System.getProperty("os.name").startsWith("Mac")) {
path = "///Users//...";
}
return path;
}
// declare paths for file source and destination
String destinationPath = path;
String sourcePath = path;
Run Code Online (Sandbox Code Playgroud)