Advertisement
Josif_tepe

Untitled

Nov 28th, 2021
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.35 KB | None | 0 0
  1. public class Cas {
  2.     public static void main(String[] args) {
  3.         Shape shape = new Shape();
  4.         shape.print(2);
  5.         shape.print();
  6.     }
  7. }
  8.  
  9. class Shape {
  10.     void print() {
  11.         System.out.println("printing without arguments");
  12.     }
  13.  
  14.     void print(int x) {
  15.         System.out.println("Printing with arguments");
  16.     }
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement