Discussion topic: Contributed Answer/Explanation to Q. 13
To go to the homepage of this topic,
click here.
Home: alokrajiv | Original Message | Reply | Subject: Contributed Answer/Explanation to Q. 14 | Answer :
Multiple funxtions with the sam identifier names with
number of parameters
datatypes of parameters
order of parameters of varying datatype
Example :
class puki
{
public static void main(String[] args)
{
call();
call(1);
call(1,2);
call(1,'a');
}
public static void call()
{
System.out.println("Hello Java");
}
public static void call(int n)
{
System.out.println(n);
}
public static void call(int a,int b)
{
System.out.println(a+" "+b);
}
public static void call(int x,char ch)
{
System.out.println(x+" "+ch);
}
}
Posted at: Thu Mar 25 16:47:19 2010 (GMT) |
Page 1 of 1 | From: alokrajiv | Reply 1 of 2 | Reply | | Subject: Contributed Answer/Explanation to Q. 14 | Answer :
Multiple funxtions with the same identifier names with
number of parameters
datatypes of parameters
order of parameters of varying datatype
Example :
class puki
{
public static void main(String[] args)
{
call();
call(1);
call(1,2);
call(1,'a');
}
public static void call()
{
System.out.println("Hello Java");
}
public static void call(int n)
{
System.out.println(n);
}
public static void call(int a,int b)
{
System.out.println(a+" "+b);
}
public static void call(int x,char ch)
{
System.out.println(x+" "+ch);
}
}
Posted at: Thu Mar 25 16:47:38 2010 (GMT)
|
From: alokrajiv | Reply 2 of 2 | Reply | | Subject: Contributed Answer/Explanation to Q. 14 | Answer :
Multiple funxtions with the same identifier names with
number of parameters
datatypes of parameters
order of parameters of varying datatype
Example :
class sample
{
public static void main(String[] args)
{
call();
call(1);
call(1,2);
call(1,'a');
}
public static void call()
{
System.out.println("Hello Java");
}
public static void call(int n)
{
System.out.println(n);
}
public static void call(int a,int b)
{
System.out.println(a+" "+b);
}
public static void call(int x,char ch)
{
System.out.println(x+" "+ch);
}
}
Posted at: Thu Mar 25 16:48:08 2010 (GMT)
|
Page 1 of 1
|
|
To post to this forum, you must be signed in as a Syvum member.
Please sign in / register as a member.