A computer science problem by Raj Maiti

observe the following coding in java and find the output:-

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
class Abc{
void process(int a)
{
System.out.print("1");
}
void process(String a[])
{
System.out.print("2");
}

public static void main(String args[])
{
new Abc().process(args);

}
}

Error!! no output!! 1 2

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Snehasis Maity
Nov 6, 2014

Answer is 2. Because process(String a[]) is called by object of Abc. And in the calling time the function is called with the proper argument(String array).

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...