I want to put the output of this for loop inside a string and print it at the end. however, it concatenating the old string value with the new one. How can I prevent this issue? help, please!
while (tupleQueryResult.hasNext()) {
BindingSet bindingSet = tupleQueryResult.next();
for (Binding binding : bindingSet) {
// Each Binding contains the variable name and the value for this result row
String name = binding.getName();
Value value = binding.getValue();
result = name + " = " + value;
System.out.println(result);
}
}