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 5 of 5

Thread: error: cannot find symbol IOEXception

  1. #1
    Junior Member
    Join Date
    Mar 2019
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default error: cannot find symbol IOEXception

    The following code fails:

    import java.io.IOException;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    import java.util.List;
     
    class Common {
      public static String getFileAsString(String filename) throws IOException {
        return new String(Files.readAllBytes(Paths.get(filename)));
      }
     
      public static List<String> getFileAsLines(String filename) throws IOEXception {
        return Files.readAllLines(Paths.get(filename));
      }
    }

    ...with output:

    Common.java:11: error: cannot find symbol
      public static List<String> getFileAsLines(String filename) throws IOEXception {
                                                                        ^
      symbol:   class IOEXception
      location: class Common
    1 error

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: error: cannot find symbol IOEXception

    Check the spelling. Java is case sensitive.
    If you don't understand my answer, don't ignore it, ask a question.

  3. The Following User Says Thank You to Norm For This Useful Post:

    readyready15728 (March 25th, 2019)

  4. #3
    Junior Member
    Join Date
    Mar 2019
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: error: cannot find symbol IOEXception

    I've never used a case-insensitive language before! I'm just tired I guess...

  5. #4
    Member
    Join Date
    Sep 2018
    Location
    Virginia
    Posts
    284
    My Mood
    Cool
    Thanks
    0
    Thanked 38 Times in 36 Posts

    Default Re: error: cannot find symbol IOEXception

    Java is not case insensitive, it is case sensitive. Case matters.

    Regards,
    Jim

  6. The Following User Says Thank You to jim829 For This Useful Post:

    readyready15728 (March 25th, 2019)

  7. #5
    Junior Member
    Join Date
    Mar 2019
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: error: cannot find symbol IOEXception

    I'm aware. I just overlooked the "X" for some reason.

Similar Threads

  1. Help me with a 'Can not find symbol' error
    By Vijay_Java in forum What's Wrong With My Code?
    Replies: 4
    Last Post: July 23rd, 2014, 04:41 AM
  2. Error:Cannot find Symbol
    By Leonardo1143 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: February 13th, 2013, 06:40 PM
  3. Cannot find symbol ERROR
    By yacek in forum What's Wrong With My Code?
    Replies: 8
    Last Post: October 21st, 2011, 11:39 PM
  4. error :cannot find symbol
    By iswan in forum AWT / Java Swing
    Replies: 1
    Last Post: October 1st, 2011, 08:26 AM
  5. Cannot find symbol error
    By AnuR in forum What's Wrong With My Code?
    Replies: 9
    Last Post: February 23rd, 2011, 02:50 PM