在我们的项目中,我们使用的是Netbeans.当我尝试提交我在Netbeans中修改过的文件时,它只显示当前文件,我必须为我修改过的每个文件做一次提交.我已经看到了我的同事可以点击"提交"的位置,它会显示他修改过的每个文件,但是我们都不知道如何更改设置以允许多个文件提交.
我试过在线寻找选项,但还没有找到答案.有没有人有什么建议?
谢谢!
以下是我的课.insertSymbol方法应该将一个对象添加到链表中,然后将其添加到哈希表中.但是当我打印哈希表的内容时,它有两个条目.我试图通过使用"if(temp.contains(value)){return;}"来纠正这个问题,但它无效.我读到我需要在几个地方使用@override.谁能帮助我知道如何以及在哪里使用覆盖?谢谢!
import java.util.*;
public class Semantic {
String currentScope;
Stack theStack = new Stack();
HashMap<String, LinkedList> SymbolTable= new HashMap<String, LinkedList>();
public void insertSymbol(String key, SymbolTableItem value){
LinkedList<SymbolTableItem> temp = new LinkedList<SymbolTableItem>();
if(SymbolTable.get(key) == null){
temp.addLast(value);
SymbolTable.put(key, temp);
}else{
temp = SymbolTable.get(key);
if(temp.contains(value)){
return;
}else{
temp.addLast(value);
SymbolTable.put(key, temp);
}
}
}
public String printValues(){
return SymbolTable.toString();
}
public boolean isBoolean(){
return true;
}
public boolean isTypeMatching(){
return true;
}
public void stackPush(String theString){
theStack.add(theString);
}
}
Run Code Online (Sandbox Code Playgroud) 这是我的示例代码.这打印出"{test = theClass @ 7096985e}"但我需要它给我类型和范围的值.我尝试了几件事 - 任何方向都会很棒.谢谢!
import java.util.*;
class theClass {
String type;
String scope;
public theClass(String string1, String string2) {
type = string1; scope = string2;
}
}
public class Sandbox {
public static void main(String[] args){
Hashtable<String, theClass> theTable = new Hashtable<String, theClass>();
theClass object = new theClass("int", "global");
theTable.put("test", object);
System.out.println(theTable.toString());
}
}
Run Code Online (Sandbox Code Playgroud)