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(StringBuffer y)
- {
- System.out.println(“StringBuffer-args”);
- }
- public static void main(String args[])
- {
- Test t = new Test();
- t.m1(new String()); ——>String
- t.m1(new StringBuffer()); ——>StringBuffer
- t.m1(null);——>error reference to m1()is ambiguous
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement