Can u overload main()method.Give with example.
Answer Posted / manikandan [ gtec,vellore ].
yes,gothrough below code.
class test
{
public static void main(String []asdff)
{
test.a();
}
public static void main(int a,int b)
{
System.out.println("over loaded");
}
static void a()
{
test.main(1,2);
}
}
| Is This Answer Correct ? | 40 Yes | 12 No |
Post New Answer View All Answers
Why are variables important in research?
Is static variable stored in heap?
What is the impact of declaring a method as final?
Why we use protected in java?
Do I need to import java.lang package any time? Why?
How are multiple inheritances done in Java?
What are the 8 primitive data types in java?
Draw a UML class diagram for the code fragment given below: public class StringApplet extends Applet { private Label sampleString; private Button showTheString; private ButtonHandler bHandler; private FlowLayout layout; public StringApplet() { sampleString = new Label(" "); showTheString = new Button (" Show the String"); bHandler = new ButtonHandler(); layout = new FlowLayout(); showTheString.addActionListener(bHandler); setLayout(layout); add(sampleString); add(showTheString); } class ButtonHandler implements ActionListener { public void actionPerformed(ActionEvent e) { samplestring.setText("Good Morning"); } } } Note: The methods need not be indicated on the diagram.
What are checked exceptions?
When should I use singleton?
How many bits is a char?
Which package is used for pattern matching with regular expressions?
Explain about the security aspect of java?
Write a program to find the whether a number is an Armstrong number or not?
What is encapsulation in java?