I am a rookie programmer in Java. I want "aaa" to be printed in main and displayed "123". In C++ if use pointer in the define arguement (e.g. char * a), and will return the value to the variable which is passed to the function.
How do I make this happen in Java? and I don't want to have a return type of String. (I need to use the argument to print). It shows null" for now.. If anyone could help I will appreciate!
public class DeppDemo {
private String aaa;
public void abc(String a) {
a = "123";
}
public static void main(String[] args) {
DeppDemo demo = new DeppDemo();
demo.abc(demo.aaa);
System.out.println(demo.aaa);
}
}