Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?

Welcome. Please Login, Register, Or Activate! 
type your username and password to login
Date: November 22, 2009, 11:53 AM
430741 members and 297862 Topics
Latest Member: johnadio
Nairaland [Nigerian Forum] Home Help Search Who is currently online? Login Register
Nairaland Forum  |  Technology  |  Programming  |  Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
Pages: (1) (2) (3) Go Down Send this topic Notify of replies
Author Topic: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?  (Read 1187 views)
javaprince (m)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #32 on: July 12, 2008, 01:42 PM »

I HAVE DONE AS YOU SAID, I HAVE POSTED THE MODIFICATION FROM THE PREVIOUS PAGE. But I didn't have time to compile them.


@sbucareer
I wrote the program and made the neccessary corrections to make the code compile. I will like to paste it here to save others from having to debug it. Hope you don't mind.


CODE

Class - MobilePhoneApplication


package Phone;

import javax.swing.UIManager;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.event.*;
import javax.swing.text.*;

public class MobilePhoneApplication extends JPanel{

  private JPanel mainPanel;
  private JPanel display;
  private JPanel keyPads;
  private JPanel keyControls;

  private JTextArea textArea;

  private JButton call;
  private JButton end;

  private ActionListener listener;
  private DocumentListener docuListen;
  private Document jDocument;


  public MobilePhoneApplication (ActionListener listener, DocumentListener docuListen){
 
     try{
            UIManager.setLookAndFeel
                ( UIManager.getSystemLookAndFeelClassName() );
        }catch(Exception e ){
        }//End try
    this.listener = listener;
    this.docuListen = docuListen;
   
    mainPanel = new JPanel();
    display   = new JPanel();
    keyPads   = keyPads();
    keyControls = new JPanel();
   
    keyControls.setLayout ( new FlowLayout( ) );
   
    call = new JButton( "Call");
    end  = new JButton ( "End" );
    keyControls.add ( call );
    keyControls.add ( end );
   
    display.setLayout ( new GridLayout (1, 1));
    textArea = new JTextArea();
    textArea.setEditable ( false );
    textArea.getDocument().addDocumentListener (docuListen);
    textArea.setForeground ( new Color (255, 50 , 10 ));
    textArea.setFont ( new Font ("Dialog", Font.BOLD, 34 ));
    textArea.setLineWrap(true);
                               

    display.add ( textArea );
   
    mainPanel.setLayout( new GridLayout(3, 1) );
    mainPanel.add ( display );
    mainPanel.add ( keyControls );
    mainPanel.add ( keyPads );
   
    call.setActionCommand ( "Call" );
    end.setActionCommand ("End" );
    call.addActionListener (listener);
    end.addActionListener ( listener );

     this.add( mainPanel );

  }//End MobilePhoneApplication Constructor


   private JPanel keyPads (){
       String values[] = {"1", "ABC2", "DEF3",
                          "GHI4", "JKL5", "MNO6",
                          "PQRS7", "TUV8", "WXYZ9",
                          "*", "0+", "#"              };
       JPanel toReturn = new JPanel();
       toReturn.setLayout (new GridLayout(4, 3));
       JButton keys[] = new JButton[values.length];
       
       for ( int index1 = 0; index1 < keys.length; index1++ ){
              keys[index1] = new JButton ( values[index1] );
       }//End for

       for (int index = 0; index < values.length; index++){
              //keys[index].setText( values[index] );
              keys[index].setActionCommand(values[index]);
              keys[index].addActionListener(this.listener);

              toReturn.add(keys[index]);
        }//End for
       
         return toReturn;
                 
  }//End keyPads method
 
  public JTextArea getTextArea (){
    return textArea;
  }//End getTextArea
 
  public void show(String string ){
    if ( textArea.getText().length() != 9 ){
        textArea.setText( textArea.getText()+string );
    }
  }//End show
 
  public void defaultMenu ( boolean set){

        call.setEnabled ( set );
        end.setEnabled ( set );
  }//End defaultMenu
 
  //Test if the TextArea has any test
  public boolean hasChar(){
    jDocument = textArea.getDocument();
    return ( jDocument.getLength() != 0 );
  }//End hasChar
 
  public void clear (){
    String text = textArea.getText();
    text = null;
    textArea.setText (text );
  }//End clear
}//End MobilePhoneApplication




Class - MobilePhoneApplication

[color=#000099]
package Phone;

import javax.swing.UIManager;
import java.awt.event.*;
import javax.swing.JApplet;
import javax.swing.JFrame;
import javax.swing.event.*;

public class MobilePhoneApplicationGUI extends JApplet
                            implements ActionListener, DocumentListener{

    private MobilePhoneApplication mobile;
   
    public MobilePhoneApplicationGUI(){
       
        mobile = new MobilePhoneApplication(this, this);
        mobile.defaultMenu(false);
        this.init();
    }//End MobilePhoneApplicationGUI

    public void init(){

          this.getContentPane().add(mobile);
   }//End init

   public void actionPerformed (ActionEvent event ){
   
    String source = event.getActionCommand();
   
        if( source.equals ( "Call" )){
                mobile.clear();
                mobile.show("Calling, ");
        }else if (source.equals ( "End" )){
                mobile.clear();
                mobile.defaultMenu(false);
        }else if ( source.equals ( "1" )){
            mobile.show("1");   
       
        }else if ( source.equals ( "ABC2" )){
           
            mobile.show("A");
        }else if ( source.equals ( "DEF3" )){
       
        }else if ( source.equals ( "GHI4" ) ){
            mobile.show("G");
       
        }else if ( source.equals ( "JKL5" ) ){
            mobile.show("J");
       
        }else if ( source.equals ( "MNO6" )){
            mobile.show("M");
       
        }else if ( source.equals ( "PQRS7") ){
            mobile.show("P");
       
        }else if (source.equals ("TUV8")){
            mobile.show("T");
       
        }else if ( source.equals ( "WXYZ9")){
            mobile.show("W");
       
        }else if (source.equals ("*" )){
            mobile.show("*");
       
        }else if ( source.equals ("0+" )){
            mobile.show("0");
       
        }else if (source.equals ( "#")){
       
        }else{
       
        }//End if

   }//End actionPerformed
   
   public void changedUpdate (DocumentEvent e ){
   }//End changedUpdate
   
   public void insertUpdate (DocumentEvent e){
    if ( mobile.hasChar() )
            mobile.defaultMenu(true);
       
   }//End insertUpdate
   
   public void removeUpdate (DocumentEvent e ){
   }//End removeUpdate

    public static void main (String args[]){

        JFrame frame = new JFrame("Mobile Phone");
        MobilePhoneApplicationGUI demo = new MobilePhoneApplicationGUI();
 
        frame.getContentPane().add (demo);
        frame.setSize(230, 600);
        frame.setLocation(550, 100);
        frame.setResizable(false);
        frame.setVisible(true);
        frame.pack();
        frame.show();
   
   /*frame.addActionListener(new ActionListener (){
    public void actionPerformed (ActionEvent e ){
        System.exit(0);
    }});
   */
        frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
}//End main

}//End MobilePhoneApplicationGUI


javaprince (m)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #33 on: July 12, 2008, 01:50 PM »

Now for Now, the code actually does not display anything. Be waiting for your update,  But meanwhile Can't we use Visual IDEs to design our Interfaces?  Huh
sayhi2ay (m)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #34 on: July 12, 2008, 01:58 PM »

is  variable declaration not automatically private ?   why do we need to put private in front ?
sbucareer (f)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #35 on: July 12, 2008, 02:31 PM »

x
sbucareer (f)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #36 on: July 12, 2008, 02:42 PM »


sayhi2ay

They are by default public identifier, try it yourself. Write a class in a pacakge and another class in a different package and create a TestCase class and try to access the attributes of each identifier without private clause.

Another reason is to make sure that JVM during the runtime encapsulation associate an attribute with its appropriate identifier.
Tell us your answer.
sayhi2ay (m)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #37 on: July 12, 2008, 02:46 PM »

a testcase class also in a different package ?

sbucareer (f)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #38 on: July 12, 2008, 02:47 PM »


Yes. TestCase in a different package.
sayhi2ay (m)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #39 on: July 12, 2008, 02:51 PM »

automatically private!, try it yourself,
sbucareer (f)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #40 on: July 12, 2008, 02:56 PM »



In the MobilePhoneApplicationGUI class we have a method called actionPerformed(ActionEvent event) This is because any class that implements an interface promises to implement it supplied method.

In our case, we implemented ActionListener class. Its supplied a method called actionPerformed (ActionEvent e), so we must implement it ourselfs. for help consult Java API

This message is for our method in the MobilePhoneApplicationGUI. So you can copy the method and paste it over the one above.

public void actionPerformed (ActionEvent e){

}//End actionPerformed



sbucareer (f)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #41 on: July 12, 2008, 02:59 PM »


sayhi2ay

Ok, you have learned that yeah, and certain that a variable declared without an identifier is automatically declared private by the JVM. Thank you sayhi2ay for that info.

But remember, it is recommended to physical write and identifier to a variable to guarantee that its behaviour will remain consistant to the written program.

sayhi2ay (m)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #42 on: July 12, 2008, 03:03 PM »

Quote from: sbucareer on July 12, 2008, 02:59 PM

sayhi2ay

Ok, you have learned that yeah, and certain that a variable declared without an identifier is automatically declared private by the JVM. Thank you sayhi2ay for that info.



without an "access specifier",

anyways, its just programming style, nothing to it , you can always put "private" so people would know you really want it private,
malone5923 (m)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #43 on: July 12, 2008, 08:49 PM »

Quote
Just want to share this piece of code with Java enthusiast. It is about Desktop programming. Mind you this code is not compiled or tested. It was typed directly onto the forum message editor. If it doesn't compile when you copy and paste it, you would need to debug it.



package Phone;

import javax.swing.UIManager;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.event.*;
import javax.swing.text.*;

public class MobilePhoneApplication extends JPanel{

  private JPanel mainPanel;
  private JPanel display;
  private JPanel keyPads;
  private JPanel keyControls;

  private JTextArea textArea;

  private JButton call;
  private JButton end;

  private ActionListener listener;
  private DocumentListener docuListen;
  private Document jDocument;


  public MobilePhoneApplication (ActionListener listener, DocumentListener docuListen){
 
     try{
            UIManager.setLookAndFeel
                ( UIManager.getSystemLookAndFeelClassName() );
        }catch(Exception e ){
        }//End try
    this.listener = listener;
    this.docuListen = docuListen;
   
    mainPanel = new JPanel();
    display   = new JPanel();
    keyPads   = keyPads();
    keyControls = new JPanel();
   
    keyControls.setLayout ( new FlowLayout( ) );
   
    call = new JButton( "Call");
    end  = new JButton ( "End" );
    keyControls.add ( call );
    keyControls.add ( end );
   
    display.setLayout ( new GridLayout (1, 1));
    textArea = new JTextArea();
    textArea.setEditable ( false );
    textArea.getDocument().addDocumentListener (docuListen);
    textArea.setForeground ( new Color (255, 50 , 10 ));
    textArea.setFont ( new Font ("Dialog", Font.BOLD, 24 ));
    display.add ( textArea );
   
    mainPanel.setLayout( new GridLayout(3, 1) );
    mainPanel.add ( display );
    mainPanel.add ( keyControls );
    mainPanel.add ( keyPads );
   
    call.setActionCommand ( "Call" );
    end.setActionCommand ("End" );
    call.addActionListener (listener);
    end.addActionListener ( listener );

     this.add( mainPanel );

  }//End MobilePhoneApplication Constructor


   private JPanel keyPads (){
       String values[] = {"1", "ABC2", "DEF3",
                          "GHI4", "JKL5", "MNO6",
                          "PQRS7", "TUV8", "WXYZ9",
                          "*", "0+", "#"              };
       JPanel toReturn = new JPanel();
       toReturn.setLayout (new GridLayout(4, 3));
       JButton keys[] = new JButton[values.length];
       
       for ( int index1 = 0; index1 < keys.length; index1++ ){
              keys[index1] = new JButton ( values[index1] );
       }//End for

       for (int index = 0; index < values.length; index++){
              //keys[index].setText( values[index] );
              keys[index].setActionCommand(values[index]);
              keys[index].addActionListener(this.listener);

              toReturn.add(keys[index]);
        }//End for
       
         return toReturn;
                 
  }//End keyPads method
 
  public JTextArea getTextArea (){
    return textArea;
  }//End getTextArea
 
  public void show(String string ){
    textArea.setText( string );
  }//End show
 
  public void defaultMenu ( boolean set){

        call.setEnabled ( set );
        end.setEnabled ( set );
  }//End defaultMenu
 
  //Test if the TextArea has any test
  public boolean hasChar(){
    jDocument = textArea.getDocument();
    return ( jDocument.getLength() != 0 );
  }//End hasChar
 
  public void clear (){
    String text = textArea.getText();
    text = null;
    textArea.setText (text );
  }//End clear
}//End MobilePhoneApplication

Sbucareer or javaprince if is not going to be much of a problem, can you please type the errors you might have received for the first code I just want to know if I can debug it. I should have done it myself but the computer I am currently using doesnt have a compiler.
Well if is going to be a problem I can always wait till I get home and use my own computer(which has a compiler).
sbucareer (f)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #44 on: July 12, 2008, 09:19 PM »


malone5923,

Asfar as I know all the current codes above are fully debugged and fully functional. Copy and paste it in a text editor like Notepad or WordPad and save them as .java respectively and run.


malone5923 (m)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #45 on: July 12, 2008, 09:52 PM »

Quote
malone5923,

Asfar as I know all the current codes above are fully debugged and fully functional. Copy and paste it in a text editor like Notepad or WordPad and save them as .java respectively and run.
As I said earlier I dont have a compiler right now but I will appreciate it if you post the executable file I only have a runtime. Thanks.
sbucareer (f)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #46 on: July 12, 2008, 10:10 PM »



Here is the bytecode and a HTML file to run with AppletViwer


MobilePhoneApplication.class
* MobilePhoneApplication.class (3.31 KB - downloaded )
MobilePhoneApplicationGUI.class
* MobilePhoneApplicationGUI.class (2.36 KB - downloaded )
MobilePhoneApplicationGUI.html
* MobilePhoneApplicationGUI.html (0.31 KB - downloaded )
sbucareer (f)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #47 on: July 12, 2008, 10:18 PM »

x
malone5923 (m)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #48 on: July 12, 2008, 10:32 PM »

I cant run the applet I used IE and Mozzila, am I missing something though I got an exception stating that the runtime could not locate the class file
Note: I have downloaded the class, this are the errors. Please be patient with me.
Java Plug-in 1.6.0_05
Using JRE version 1.6.0_05 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\Administrator


----------------------------------------------------
c:   clear console window
f:   finalize objects on finalization queue
g:   garbage collect
h:   display this help message
l:   dump classloader list
m:   print memory usage
o:   trigger logging
p:   reload proxy configuration
q:   hide console
r:   reload policy configuration
s:   dump system and deployment properties
t:   dump thread list
v:   dump thread stack
x:   clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------

load: class MobilePhoneApplicationGUI.class not found.
java.lang.ClassNotFoundException: MobilePhoneApplicationGUI.class
   at sun.applet.AppletClassLoader.findClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at sun.applet.AppletClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at sun.applet.AppletClassLoader.loadCode(Unknown Source)
   at sun.applet.AppletPanel.createApplet(Unknown Source)
   at sun.plugin.AppletViewer.createApplet(Unknown Source)
   at sun.applet.AppletPanel.runLoader(Unknown Source)
   at sun.applet.AppletPanel.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
sbucareer (f)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #49 on: July 12, 2008, 10:34 PM »

x
malone5923 (m)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #50 on: July 12, 2008, 10:44 PM »

I do you create a package without a compiler Huh.
If I am getting it all wrong please explain in details.
sbucareer (f)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #51 on: July 12, 2008, 10:52 PM »


I have explained it above. How to create a pacakge.
malone5923 (m)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #52 on: July 12, 2008, 11:28 PM »

Sorry, I just saw the modifications you made to your previous post, It wasnt much help why because as I stated earlier I don't have a Compiler to make changes to the java file. But the link worked well(I guess thats Ok). Thanks
sbucareer (f)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #53 on: July 13, 2008, 09:50 AM »

x
sbucareer (f)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #54 on: July 13, 2008, 09:51 AM »



This is the MobilePhoneApplicationGUI

package Phone;

import javax.swing.UIManager;
import java.awt.event.*;
import javax.swing.JApplet;
import javax.swing.JFrame;
import javax.swing.event.*;

public class MobilePhoneApplicationGUI extends JApplet
                            implements ActionListener, DocumentListener{

    private MobilePhoneApplication mobile;
   
    public MobilePhoneApplicationGUI(){
       
        mobile = new MobilePhoneApplication(this, this);
        mobile.defaultMenu(MobilePhoneApplication.FALSE);
        this.init();
    }//End MobilePhoneApplicationGUI

    public void init(){

          this.getContentPane().add(mobile);
   }//End init

   public void actionPerformed (ActionEvent event ){
   
    String source = event.getActionCommand();
   
        if( source.equals ( "Call" )){
                mobile.clear();
                mobile.show("connecting, ");
                mobile.enableCall(MobilePhoneApplication.FALSE);
                mobile.setButtons(MobilePhoneApplication.FALSE);
                mobile.enableEnd(MobilePhoneApplication.TRUE);
        }else if (source.equals ( "End" )){
                mobile.clear();
                mobile.defaultMenu(MobilePhoneApplication.FALSE);
                mobile.setButtons(MobilePhoneApplication.TRUE);
        }else if ( source.equals ( "1" )){
            mobile.show("1");   
       
        }else if ( source.equals ( "ABC2" )){
           
            mobile.show("2");
        }else if ( source.equals ( "DEF3" )){
            mobile.show("3");
       
        }else if ( source.equals ( "GHI4" ) ){
            mobile.show("4");
       
        }else if ( source.equals ( "JKL5" ) ){
            mobile.show("5");
       
        }else if ( source.equals ( "MNO6" )){
            mobile.show("6");
       
        }else if ( source.equals ( "PQRS7") ){
            mobile.show("7");
       
        }else if (source.equals ("TUV8")){
            mobile.show("8");
       
        }else if ( source.equals ( "WXYZ9")){
            mobile.show("9");
       
        }else if (source.equals ("*" )){
            mobile.show("*");
       
        }else if ( source.equals ("0+" )){
            mobile.show("0");
       
        }else if (source.equals ( "#")){
             mobile.show("#");
        }else{
         mobile.show("You stole this phone!");
       
        }//End if

   }//End actionPerformed
   
   public void changedUpdate (DocumentEvent e ){
   }//End changedUpdate
   
   public void insertUpdate (DocumentEvent e){
    if ( mobile.hasChar() )
            mobile.defaultMenu(MobilePhoneApplication.TRUE);
            mobile.enableEnd(MobilePhoneApplication.FALSE);
       
   }//End insertUpdate
   
   public void removeUpdate (DocumentEvent e ){
   }//End removeUpdate

    public static void main (String args[]){

        JFrame frame = new JFrame("Mobile Phone");
        MobilePhoneApplicationGUI demo = new MobilePhoneApplicationGUI();
 
        frame.getContentPane().add (demo);
        frame.setSize(230, 600);
        frame.setLocation(550, 100);
        frame.setResizable(MobilePhoneApplication.FALSE);
        frame.setVisible(MobilePhoneApplication.TRUE);
        frame.pack();
        frame.show();
   
   /*frame.addActionListener(new ActionListener (){
    public void actionPerformed (ActionEvent e ){
        System.exit(0);
    }});
   */
        frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
}//End main

}//End MobilePhoneApplicationGUI


sbucareer (f)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #55 on: July 13, 2008, 12:32 PM »

x

MobilePhoneApplicationException.java
* MobilePhoneApplicationException.java (0.5 KB - downloaded )
sbucareer (f)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #56 on: July 13, 2008, 01:47 PM »

x
javaprince (m)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #57 on: July 13, 2008, 07:14 PM »

sbu Have done has u sent.
sayhi2ay (m)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #58 on: July 13, 2008, 07:24 PM »

java genius!


if you keep privatizing all your declarations, then we wont be able to extend your classes and methods,
sbucareer (f)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #59 on: July 13, 2008, 09:17 PM »


sayhi2ay

You can always use a callback methods. That is the whole point of it, to stop your code looking like spaghetti.

Remember software cohession. Sorry, I am used to software developing to programming.
sayhi2ay (m)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #60 on: July 13, 2008, 09:30 PM »

and if you want to extend classes or methods in the same code  ?
sbucareer (f)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #61 on: July 13, 2008, 09:34 PM »

x
sayhi2ay (m)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #62 on: July 13, 2008, 09:37 PM »

if you are extending the attributes of a class to another class in the same code ?  you are just calling a method in the code you wrote,
sbucareer (f)
Re: Java Server Pages (jsp) Or Java Server Face(jsf Which Path To Trend? ? ? ?
« #63 on: July 13, 2008, 09:43 PM »


You do not extend attributes of any class in Java instead you inherit the public attributes and methods of a super class or protected methods and attributes of the same class package.

private attributes makes your variable immutable by any inquiring accessor, you only expose them by using callbacks.Java calls them setter and getter, i.e let take a variable int qty


//callbacks
int getQty(){return qty;}
void setQty (int qty) {this.qty = qty;}

their first name must start with set for mutable and get immutable
 Software Packaging  Article: Why A Career In Computer Programming Sucks  What Is Wrong With Jamb Online Registration Web Application ?  Page 2
Pages: (1) (2) (3) Go Up Send Topic to Friend by E-mail Reply 


Sections: Autos/Cars (2) Jobs/Vacancies (2) (3) Career Talk Education General(2) Politics Romance Computers Phones Travel
Sports Fashion Health Religion Celebrities TV/Movies (2) Music/Radio (2) Books Webmasters Programming

Links: Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 Page10

Nairaland is owned by Oluwaseun Osewa. See also: Nairalist Classified Ads
Nairaland Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.