Can you call a constructor within a constructor?

Answer Posted / harpreet

And to call the constructor of some other class, use super()

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is Marker interface?

621


How concurrent hashmap works?

613


what is the purpose of using rmisecuritymanager in rmi?

568


How can a gui component handle its own events in java programming?

539


What is constructor and its types?

541






What is exception in java?

570


What is the advantage of OOP in java?

663


What do you mean by Hash Map and Hash Table?

606


What is jpa specification?

539


What is java virtual machine? Explain

571


Can an interface extend another interface?

602


What is the base class of all classes?

572


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.

1590


Is char a method in java?

520


Is space a string in java?

515