Total members 11893 |It is currently Wed Nov 06, 2024 12:17 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





using a constructor in JSP page ,i call the constructor of the class Home

Code:
<HTML>
    <
HEAD>
        <
TITLE>JSP and Using a Constructor</TITLE>
    </
HEAD>

    <
BODY>
    <
H1>Using a Constructor</H1>

    <% 
mybeans.Home H = new mybeans.Home("JSP Examples Home"); %>

    
Home is : <%= H.HomeName() %> 
  </
BODY>
</
HTML>
 


Code:

package mybeans
;

public class 
Home
{
    
String HomeName;

    public 
Home(String Name
    {
        
HomeName Name;
    }

    public 
String HomeName() {
      return 
HomeName;
    }
}
 




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time

hello sir can u tell me wat exactly happend here in ur code



Author:
Newbie
User avatar Posts: 7
Have thanks: 0 time

Just simple of creating object in JSP and calling constructor .


_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 3 posts ] 

  Related Posts  to : Using a Constructor in jsp
 What Are Constructor Methods?     -  
 using of String constructor     -  
 Class with a Constructor in php     -  
 Copy Constructor     -  
 class with constructor parameter     -  
 cannot find symbol constructor     -  



Topic Tags

Servlets/JSP






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com