Code Snippets in JAVA Programming and their OUTPUTS-1
CODE SNIPPETS OUTPUT
public class Test
{
public static void main(String[] args)
{
int[] arr = {10,20,30,40,50};
for (int k : arr)
{
System.
out.
println( k);
}
}
}
10
20
30
40
50
public class Test
{...
More
Code Snippets in JAVA Programming and their OUTPUTS-1
CODE SNIPPETS OUTPUT
public class Test
{
public static void main(String[] args)
{
int[] arr = {10,20,30,40,50};
for (int k : arr)
{
System.
out.
println( k);
}
}
}
10
20
30
40
50
public class Test
{
static void show(int i,float f)
{
System.
out.
println("hello");
}
static void show(float i,int f)
{
System.
out.
println("hello1");
}
public static void main(String[] args)
{
show(4,4);
}
}
COMPLILETIME ERROR
reference to show is
ambiguous, both method
show(int,float) in Test
and method
show(float,int) in Test
match
Less