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"); } }

26th Jun 2019, 10:08 AM
Boy Arya
Boy Arya - avatar
3 odpowiedzi
0
do is reserves keyword in java, you cant use that for function or variable or class
26th Jun 2019, 10:17 AM
Taste
Taste - avatar
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
26th Jun 2019, 10:18 AM
yuulye
yuulye - avatar
0
oke thnks all for the help
26th Jun 2019, 10:36 AM
Boy Arya
Boy Arya - avatar