Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2013
    Posts
    8
    Rep Power
    0

    Default what is wrong with this code pls

    public class Rational {
    public static void main(String[] args){
    String fruit = "banana";


    int index = fruit.indexOf('a');
    }
    }

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,560
    Blog Entries
    7
    Rep Power
    21

    Default Re: what is wrong with this code pls

    What is the code supposed to do and what does it do instead?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default Re: what is wrong with this code pls

    Syntactically, nothing. It doesn't DO anything (i.e. it produces no output), but we don't know what it SHOULD be doing.

Similar Threads

  1. what's wrong with this code?
    By worldchamp in forum New To Java
    Replies: 6
    Last Post: 11-30-2012, 09:49 AM
  2. What is wrong with the Code below
    By Bahramudin in forum New To Java
    Replies: 4
    Last Post: 08-16-2012, 07:10 PM
  3. What is wrong with my code?
    By loosemember in forum New To Java
    Replies: 1
    Last Post: 12-03-2010, 01:20 AM
  4. What is wrong with this code
    By rosh72851 in forum New To Java
    Replies: 13
    Last Post: 10-31-2008, 01:50 AM
  5. What's wrong with this code?
    By Wizard wusa in forum New To Java
    Replies: 14
    Last Post: 01-22-2008, 11:55 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
  •