Thread: JAVA and J2EE
View Single Post
  #3 (permalink)  
Old 11-29-2007, 04:13 AM
rgbosque rgbosque is offline
Member
 
Join Date: Nov 2007
Posts: 16
Rep Power: 0
rgbosque is on a distinguished road
Default
thenks a lot Eranga...
then what should i learn first as a newbie on this language?

Additional:
if i run this simple code of "if then statement" the name Variable is not returning TRUE if i entered a "RODEL". Is "if then statement" is only for numbers?
Thanks in advance...

This is a code:
import javax.swing.JOptionPane;

class DialogBox {
public static void main(String[] args) {

JFrame frame = new JFrame();

String name = JOptionPane.showInputDialog("What is your name:");

if (name == "Rodel") {
JOptionPane.showMessageDialog(frame,"You are " + name);
}
else {
JOptionPane.showMessageDialog(frame,"I Dont Recognize Your Name");
}


}
}

Last edited by rgbosque; 11-29-2007 at 04:15 AM. Reason: wrong Jave Code Presentation
Reply With Quote