What happens when a main method is declared as private?
Answer Posted / subha narayan mohapatra
it will generate an error message because main() method is
the start or execution point in our java program.
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
What is object of class in java?
What is the meaning of 3 dots in java?
How will you compute size of a structure?
what is synchronization? : Java thread
What are the various access specifiers in java?
What is stringbuffer in java?
What is a parameter in matrices?
Why string objects are immutable in java?
what is an objects lock and which objects have locks? : Java thread
Explain about java sdk?
What is numel matlab?
How do you escape a string?
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.
How can we create objects if we make the constructor private ?
Can we sort hashset in java?