Results 1 to 4 of 4
  1. #1
    _nik_ is offline Member
    Join Date
    Jan 2008
    Posts
    1
    Rep Power
    0

    Default Pls some one to help mi wit this code

    PLS some one to help me wit this code because it's says that there is some error but I can't find the error.

    //For example
    import javax.swing.*;
    import java.util.*;

    public class TestJOptionPane
    {
    public static void main(String[]args)
    {
    Date currentDate = new Date();
    System.out.println("Hi! What is your name?");
    System.out.println("My name is Nikolay Ivanov\n"+ currentDate)
    JOptionPane.showMessageDialog(null,"nik!\n" + currentDate,
    "application output",
    JOptionPane.QUESTION_MESSAGE);
    }
    }

  2. #2
    CaptainMorgan's Avatar
    CaptainMorgan is offline Moderator
    Join Date
    Dec 2007
    Location
    NewEngland, US
    Posts
    835
    Rep Power
    9

    Default

    First, welcome to the Java Forums.

    Second, what seems to be the problem? Have you tested this code by running it? If not, I suggest you do so. The error you are experiencing is so fundamental that if you can't find it in this short program, then I'm not sure programming is for you. If you've just begun, definitely start with a book like Head First Java, Kathy Sierra and Bert Bates.

    Lastly, please use full English constructed sentences and words. 'pls', 'wit' and 'mi' do not satisfy this simple requirement. Not everyone writes shorthand like you, but a lot of people can read full English - this is a simple courtesy. And, please use code tags when posting code.

    Thanks for your understanding and cooperation. See you around!
    -Capt
    Vote for the new slogan to our beloved Java Forums! (closes on September 4, 2008)
    Want to voice your opinion on your IDE/Editor of choice? Vote now!
    Got a little Capt'n in you? (drink responsibly)

  3. #3
    chitwood is offline Member
    Join Date
    Jan 2008
    Posts
    23
    Rep Power
    0

    Default Problem fixed!!

    import javax.swing.JOptionPane;
    import java.util.*;

    public class Test {
    public static void main(String[] args) {
    Date currentDate = new Date();
    System.out.println("Hi! What is your name?");
    System.out.println("My name is Nikolay Ivanov\n"+ currentDate);
    JOptionPane.showMessageDialog(null,"nik!\n" + currentDate,
    "application output",
    JOptionPane.QUESTION_MESSAGE);
    }
    }

  4. #4
    Leprechaun is offline Member
    Join Date
    Dec 2007
    Posts
    30
    Rep Power
    0

    Default

    chitwood added a ; if you didn't notice. Every statement has to end with one so... get used to it.

Similar Threads

  1. Need help with my code.
    By stormviper in forum New To Java
    Replies: 8
    Last Post: 11-18-2013, 04:58 PM
  2. I need help fixing my code.. or non code?
    By MrHuggykins in forum New To Java
    Replies: 1
    Last Post: 03-19-2008, 11:12 PM
  3. I need help on my code
    By jason27131 in forum New To Java
    Replies: 4
    Last Post: 07-28-2007, 05:23 AM
  4. tic tac toe code
    By zoe in forum New To Java
    Replies: 1
    Last Post: 07-23-2007, 05:36 PM
  5. Replies: 1
    Last Post: 04-26-2007, 04:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •