Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Failed to compile, URGENT please help. Can't compile using JDK

  1. #1
    Junior Member
    Join Date
    Jul 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Failed to compile, URGENT please help. Can't compile using JDK

    Hello friends, I have question to ask why I am not able to compile this 3 Java files using JDK. The method I used to compile this 3 files are using

    command prompt, javac <direction>.java

    But i failed to compile because of Ticket.Java issue and Main.java.

    I have define everything in ticket.java but in my Main.java, line 504,505,506 and 512 got problem.

    Something wrong with here :

    int childTicketPrice = Ticket.getSeatPrice(childInput, "child");
    int adultTicketPrice = Ticket.getSeatPrice(adultInput, "adult");
    int oapTicketPrice = Ticket.getSeatPrice(oapInput, "oap");

    // Calculate total
    int total = (childTicketPrice +adultTicketPrice+oapTicketPrice);

    //Convert this integer value to a string in the correct format
    String totalString = Ticket.calculateStringTotal(total);

    the = ticket , here is having issue.

    How to fix this?

    My extra question, is JDK not the correct method to compile this 3 files? Please let me know thanks
    Attached Files Attached Files


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,301
    My Mood
    Mellow
    Thanks
    193
    Thanked 669 Times in 656 Posts

    Default Re: Failed to compile, URGENT please help. Can't compile using JDK

    Post your errors.

  3. #3
    Junior Member
    Join Date
    Jul 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Failed to compile, URGENT please help. Can't compile using JDK

    I have uploaded an winrar file, including 3 java files, can you help me find out the reason why i can't compile it? please would be very appreciated. Because the codes are too many.

    The problem is the ticket.java

    Main.java can't find the ticket.java which is linked using method

Similar Threads

  1. Urgent! How to compile a whole library to Jar
    By JavaCup in forum Java Theory & Questions
    Replies: 2
    Last Post: May 11th, 2012, 11:46 AM
  2. Cannot get to compile
    By theoneyouenvy in forum What's Wrong With My Code?
    Replies: 4
    Last Post: April 19th, 2011, 10:17 PM
  3. Cannot get to compile
    By Goff256 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: April 19th, 2011, 01:09 PM
  4. [SOLVED] I CANT COMPILE
    By savvas in forum What's Wrong With My Code?
    Replies: 3
    Last Post: March 31st, 2011, 11:34 AM
  5. need help to compile
    By hardwarewizard in forum Java Theory & Questions
    Replies: 0
    Last Post: February 14th, 2010, 09:03 AM