Why does jcomponent have add() and remove() methods but the component does not?



Why does jcomponent have add() and remove() methods but the component does not?..

Answer / Pramod Pratap Singh

In the JSP context, `JComponent` extends `java.awt.Container`, which provides the `add()` and `remove()` methods for adding and removing child components, respectively. On the other hand, `Component` is a superclass of both `JComponent` and `javax.servlet.jsp.tagext.SimpleTagSupport`, and it does not have these methods because they are specific to handling GUI components in Swing (for JComponents) and are not relevant for server-side components.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JSP Interview Questions

What is the scope of response object?

1 Answers  


Can an interface be implemented in the jsp file?

1 Answers  


What is jsp taglib?

1 Answers  


How is jsp include directive different from jsp include action. ?

1 Answers  


How can my application get to know when a httpsession is removed?

1 Answers  


How to get value from java to jsp page?

1 Answers  


What is expression tag in jsp?

1 Answers  


What are the different types of jstl tags?

1 Answers  


How can a thread safe JSP page be implemented?

1 Answers  


What Do you Mean By Object Serialization in java.

2 Answers   Accenture, Cognizant,


What is difference between page and pagecontext in jsp?

1 Answers  


What is application scope in jsp?

1 Answers  


Categories