Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


can we overload main method?

Answers were Sorted based on User's Feedback



can we overload main method?..

Answer / thiru.guru83@yahoo.com

yes

Is This Answer Correct ?    14 Yes 1 No

can we overload main method?..

Answer / shrirang & chetak

yes , we can overlode main method but we can not override
main method

example :
class a
{
public void main()
{
System.out.println("0.00000000");
}

public static void main(String ar[])
{
a A=new a();
A.main();
}
}

Is This Answer Correct ?    13 Yes 4 No

can we overload main method?..

Answer / pradeep

yes i agree with chetak. we can overload but we can't override

Is This Answer Correct ?    7 Yes 3 No

can we overload main method?..

Answer / sujith.v.m

Yes,
Because signature is different in main function so it will be overloaded.

Is This Answer Correct ?    5 Yes 2 No

can we overload main method?..

Answer / mounika

yes we can overload becoz we can use different signatures to main method

Is This Answer Correct ?    4 Yes 2 No

can we overload main method?..

Answer / teja

no

Is This Answer Correct ?    10 Yes 9 No

can we overload main method?..

Answer / atul

class mainoverloaded
{
public void main()
{
System.out.println("Hey");
}
public void main(int a)

{
System.out.println(a);
}
}
class maind
{
public static void main(String ah[])
{
mainoverloaded m=new mainoverloaded();
m.main();
m.main(10);
}

}
please execute this code.it is execute correctly.

Is This Answer Correct ?    1 Yes 0 No

can we overload main method?..

Answer / srinivaskumar.nimmana

Yes, we can... like this,

public static void main(String[] args){....}
pulbic void main(int a){....}
public static int main(flaot f){....}
public String main(string s){....}

in the above code public static void main(string[] args) executed as thread remaining methods are normal methods in our java class. in jvm p.s.v.main(string[] args) defined with thread so jvm always search for this syntax only.any other main() with diffrent parameters are consider as normal method

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More Core Java Interview Questions

Wha is the output from system.out.println(“hello”+null); ?

0 Answers  


Why is core java important?

0 Answers  


Is class is a data type?

0 Answers  


public class Base { public void myMethod(int a,intb) {} } // Uses myMethod and then hides it. public class DerivedOne extends Base { private void myMethod(int a,int b); } will this compile or not .yes or no. why

2 Answers  


Distinguish between a predicate and a function?

0 Answers  


java Technical questions asked by JPMC

0 Answers   JPMorgan Chase,


Which class is the immediate superclass of the Container class?

1 Answers  


Is it possible for yielded thread to get chance for its execution again ?

0 Answers  


How do you read a char in java?

0 Answers  


What is audio clip interface? Name few methods of it ?

1 Answers  


Will set allow duplicates in java?

0 Answers  


why not override thread to make a runnable? : Java thread

0 Answers  


Categories