Question: Why is there an error in the following code? package mid; 1 2 P m ST LO 10 7 CO 9 10 - 14

  

Why is there an error in the following code? package mid; 1 2 P m ST LO 10 7 CO 9 10 - 14 15 public class OverDemo { public static void func1(int x, double y) { } } public void func1 (double a, double b) { } public static void main(String[] args) { Over Demo od = new OverDemo (); od. func1(2,2.5); Over Demo.funcl (2.3, 1); }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The error in the provided code is that the method func1 is defined twice but with different signatur... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!