Java Code Snippet-5
/**
*
*/
package techyield;
/**
* @author satyanarayana gokavarapu
*
*/
public class Super {
void init( int a,int b)
{
System.out.println("Super class int,int method.");
}
void init( long a,long b)
{
System.out.println("Super class long,long method.");
}
void init( Long a,Long b)
{
System.out.println("Super class Long,Long method.");
}
}
package techyield;
/**
* @author satyanarayana gokavarapu
*
*/
public class Test extends Super{
public static void main(String[] args) {
// TODO Auto-generated method stub
Test object = new Test();
object.init(2,3);
}
void init(int... a)
{
System.out.println("Test class varargs method.");
}
}
Select an answer
Please comment below if you have any doubts.