0
Why the code bekow not show the output result...anyone can help me
class A { public void do () { System.out.println ("A"); } public void do (String str) { System.out.println (str); } } class B { public static void main(String[] args) { A object = new A(); object.do("B"); } }
3 Answers
0
do is reserves keyword in java, you cant use that for function or variable or class
0
https://code.sololearn.com/cs8AhN1fk4TG/?ref=app
Try changing the function name "do" with something else, it is a keyword in Java and probably many others
0
oke thnks all for the help