Page 2 of 2 First 12
  • Jump to page:
    #16
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    10
    Rep Power
    0

    I fixed the Array List problem (It wasn't imported)


    But I have 10 new errors, many of which are about not being able to find a symbol, mainly the .length. Here is a full list of the errors, with the ones I have no idea about under it:
    Code:
    C:\Users\jdaniels\Desktop\Grady's Files\Java Projects\Java\marqueemaker.java:16: error: cannot find symbol
    		input = sc.nextString();
    		          ^
      symbol:   method nextString()
      location: variable sc of type Scanner
    C:\Users\jdaniels\Desktop\Grady's Files\Java Projects\Java\marqueemaker.java:19: error: cannot find symbol
    		output = sc.nextString();
    		           ^
      symbol:   method nextString()
      location: variable sc of type Scanner
    C:\Users\jdaniels\Desktop\Grady's Files\Java Projects\Java\marqueemaker.java:24: error: no suitable constructor found for ArrayList(char[])
            ArrayList inputArray = new ArrayList(input.toCharArray());
                                   ^
        constructor ArrayList.ArrayList(Collection) is not applicable
          (actual argument char[] cannot be converted to Collection by method invocation conversion)
        constructor ArrayList.ArrayList() is not applicable
          (actual and formal argument lists differ in length)
        constructor ArrayList.ArrayList(int) is not applicable
          (actual argument char[] cannot be converted to int by method invocation conversion)
    C:\Users\jdaniels\Desktop\Grady's Files\Java Projects\Java\marqueemaker.java:25: error: no suitable constructor found for ArrayList(char[])
            ArrayList outputArray = new ArrayList(output.toCharArray());
                                    ^
        constructor ArrayList.ArrayList(Collection) is not applicable
          (actual argument char[] cannot be converted to Collection by method invocation conversion)
        constructor ArrayList.ArrayList() is not applicable
          (actual and formal argument lists differ in length)
        constructor ArrayList.ArrayList(int) is not applicable
          (actual argument char[] cannot be converted to int by method invocation conversion)
    C:\Users\jdaniels\Desktop\Grady's Files\Java Projects\Java\marqueemaker.java:35: error: array required, but ArrayList found
    				if(inputArray[i] == outputArray[j]) {
    				             ^
    C:\Users\jdaniels\Desktop\Grady's Files\Java Projects\Java\marqueemaker.java:35: error: array required, but ArrayList found
    				if(inputArray[i] == outputArray[j]) {
    				                               ^
    C:\Users\jdaniels\Desktop\Grady's Files\Java Projects\Java\marqueemaker.java:43: error: cannot find symbol
            for(int k=1; k<outputArray.length; k++) {
                                      ^
      symbol:   variable length
      location: variable outputArray of type ArrayList
    C:\Users\jdaniels\Desktop\Grady's Files\Java Projects\Java\marqueemaker.java:44: error: array required, but ArrayList found
    			System.out.print(outputArray[k] + ", ");
    			                            ^
    C:\Users\jdaniels\Desktop\Grady's Files\Java Projects\Java\marqueemaker.java:49: error: cannot find symbol
            for(int k=1; k<outputArray.length; k++) {
                                      ^
      symbol:   variable length
      location: variable outputArray of type ArrayList
    C:\Users\jdaniels\Desktop\Grady's Files\Java Projects\Java\marqueemaker.java:50: error: array required, but ArrayList found
    			System.out.print(outputArray[k] + ", ");
    			                            ^
    10 errors
    
    Tool completed with exit code 1
    Code:
    constructor ArrayList.ArrayList(Collection) is not applicable
          (actual argument char[] cannot be converted to Collection by method invocation conversion)
        constructor ArrayList.ArrayList() is not applicable
          (actual and formal argument lists differ in length)
        constructor ArrayList.ArrayList(int) is not applicable
          (actual argument char[] cannot be converted to int by method invocation conversion)
    C:\Users\jdaniels\Desktop\Grady's Files\Java Projects\Java\marqueemaker.java:25: error: no suitable constructor found for ArrayList(char[])
            ArrayList outputArray = new ArrayList(output.toCharArray());
                                    ^
        constructor ArrayList.ArrayList(Collection) is not applicable
          (actual argument char[] cannot be converted to Collection by method invocation conversion)
        constructor ArrayList.ArrayList() is not applicable
          (actual and formal argument lists differ in length)
        constructor ArrayList.ArrayList(int) is not applicable
          (actual argument char[] cannot be converted to int by method invocation conversion)
    C:\Users\jdaniels\Desktop\Grady's Files\Java Projects\Java\marqueemaker.java:35: error: array required, but ArrayList found
    				if(inputArray[i] == outputArray[j]) {
    The code still isn't liking the scanner class, which still confuses me. Anyone who has any inkling on this subject, please skype me at epicmanyay1
  2. #17
  3. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,711
    Rep Power
    347
    Do you have the link to the API doc?
    Here it is: http://docs.oracle.com/javase/7/docs/api/

    The Scanner and .length problems can be solved if you read the API doc for the Scanner class and the ArrayList classes.

    Also the ArrayList constructor arguments are shown there.
  4. #18
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    10
    Rep Power
    0
    Originally Posted by NormR
    Do you have the link to the API doc?
    Here it is: http://docs.oracle.com/javase/7/docs/api/

    The Scanner and .length problems can be solved if you read the API doc for the Scanner class and the ArrayList classes.

    Also the ArrayList constructor arguments are shown there.
    Ok, I'll look over those, and hopefully find my error.
Page 2 of 2 First 12
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo