Search:

Type: Posts; User: Java girl

Search: Search took 0.09 seconds.

  1. Replies
    19
    Views
    1,225

    Re: 1 MINOR ERROR IN PROGRAM

    ok so how do i go about putting a String value on each element of the array ?
  2. Replies
    19
    Views
    1,225

    Re: 1 MINOR ERROR IN PROGRAM

    package practice;

    import java.util.*;
    import java.io.*;

    public class New2 {
    public static void main(String[] args) throws IOException{

    String words []= new String [20];
    Scanner in=...
  3. Replies
    19
    Views
    1,225

    Re: 1 MINOR ERROR IN PROGRAM

    or, well I fixed that but the error is now:
    Exception in thread "main" java.lang.NullPointerException
    at practice.New2.main(New2.java:19)
  4. Replies
    19
    Views
    1,225

    Re: 1 MINOR ERROR IN PROGRAM

    yes,words [] = in.nextLine(); is causing the compilation error
  5. Replies
    19
    Views
    1,225

    Re: 1 MINOR ERROR IN PROGRAM

    Well, I am still getting the ArrayIndexOutOfBoundsException error so I am unable to run it successfully.
    Here is my current program:



    package practice;

    import java.util.*;
    import java.io.*;
  6. Replies
    19
    Views
    1,225

    Re: 1 MINOR ERROR IN PROGRAM

    This is how the file i am attempting to read from is layout:
    Umbrella
    Rain
    Jacket
    Boots
    Geography
    Pizza
    Music
    Disco
    Roti
  7. Replies
    19
    Views
    1,225

    Re: 1 MINOR ERROR IN PROGRAM

    Same run time error exists even after the correct format but thanks
  8. Replies
    19
    Views
    1,225

    Re: 1 MINOR ERROR IN PROGRAM

    My fixing the syntax error, the other error removed and I was able to run my program:



    package practice;

    import java.util.*;
    import java.io.*;

    public class New2 {
  9. Replies
    19
    Views
    1,225

    Re: 1 MINOR ERROR IN PROGRAM

    I decided to practice it with files instead since it is one of y weak areas so here is the updated program:



    package practice;

    import java.util.*;
    import java.io.*;

    public class New2 {
  10. Replies
    19
    Views
    1,225

    1 MINOR ERROR IN PROGRAM

    Hi,
    here is my program:



    package practice;

    import java.util.*;
    public class New2 {
    public static void main(String[] args) {
Results 1 to 10 of 10