I want to append a string at runtime but this code again add the previous word not to append new word.
Customer.java:
public String getCustomerQuestion() {
return CustomerQuestion;
}
public void setCustomerQuestion(String customerQuestion) {
CustomerQuestion = customerQuestion;
}
public void appendmessage(String msg){
CustomerQuestion = CustomerQuestion +" "+ msg;
}
Main.java:
Customer _Customer =new Customer();
Request_Message Request= new Request_Message;
_Customer.setCustomerQuestion(Request.getInput());
String _string=Request.getInput();
_Customer.appendmessage(_string);
String str=__Customer.getCustomerQuestion();
System.out.println("now new Question() is"+str);
When I write ram then press enter after again when I write singh it show result: ram ram on console. I want to show display ram singh as a string. `public class Request_Message { { private String _Input;
public void setInput (String line) { _Input = line; } public String getInput() { return _Input; }`
It takes the input from a chat window.
__Customer? Also very strange naming scheme of instance variables. Capital letters?