Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Test
- {
- public void m1(String x)
- {
- System.out.println(“String-args”);
- }
- public void m1(Object o)
- {
- System.out.println(“Object-args”);
- }
- public static void main(String[]args)
- {
- Test t = new Test();
- t.m1(new String()); ——>String args
- t.m1(new Object()); ——>object args
- t.m1(null); ——>String args
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement