Advertisement
zoro-10

Pr1b.java

Mar 30th, 2024
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.35 KB | None | 0 0
  1. class M_Over {
  2.  
  3.   public int add(int a, int b) {
  4.     return a + b;
  5.   }
  6.  
  7.   public int add(int a, int b, int c) {
  8.     return a + b + c;
  9.   }
  10. }
  11.  
  12. public class Pr1b {
  13.  
  14.   public static void main(String args[]) {
  15.     M_Over obj = new M_Over();
  16.     System.out.println("Sum=" + obj.add(5, 6));
  17.     System.out.println("Sum2=" + obj.add(5, 6, 10));
  18.   }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement