Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Thanks for your explanation! How can I avoid this error or change it to warning?
- Mike Zang
What will be the out put for below program ? class B{ public void foo(Object o) { System.out.println(“Object”); } public void foo(Exception e) { System.out.println(“Exception”); } public void foo(NullPointerException ne) { System.out.println(“NullPointerException”); } public void foo(String ne) { System.out.println(“String”); } } class A extends B { public static void main(String[] args) { B b=new B(); new B().foo(null); } } Could you please explain ? Thanks, Bhargav
- Bhargav
Class Met { public void m(int a,float b) { System.out.println(“first m”); } Public void m(float a,char b) { System.out.println(“sec m”); } } Class Main1 { Public static void main (string arg[]) { Met n= new Met(); n.m( ‘c’,‘c’); } Output is ambiguous ,why it is ambiguous and can I know the reason and procedure for checking it Thanks
- Ravi teja
Good explanation on ambiguity in method overloading. https://www.youtube.com/watch?v=xlSRf7psJHE
- Kavita
Hi All, I am using java 8 and in my system haven’t any warning regarding B b=new B(); new B().foo(null); And because of public void foo(String ne) { System.out.println(“String”); } overloaded method java display ambiguous error. eighter use public void foo(Exception e) { System.out.println(“Exception”); } public void foo(NullPointerException ne) { System.out.println(“NullPointerException”); } Or use public void foo(String ne) { System.out.println(“String”); }
- Umesh Soni
public class PolyDemo3 { public static void main(String[] args) { PolyDemo3 p1=new PolyDemo3(); //p1.funA(); A x=new A(); p1.funA(x); p1.funA(new A()); p1.funA(null); A y=new A(); p1.funA(y); p1.funA(new A()); A z=new A(); p1.funA(z); p1.funA(new A()); } void funA() { System.out.println(“funA of PolyDemo3”); } void funA(A a1) { System.out.println(“classA of PolyDemo3”); System.out.println(a1); } void funA(B a1) { System.out.println(“classB of PolyDemo3”); System.out.println(a1); } void funA(C a1) { System.out.println(“classC of PolyDemo3”); System.out.println(a1); } } how to call the null address in class A and B and C
- chaitanya