File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

If objects can't be passed....

 
Janeice DelVecchio
Saloon Keeper
Posts: 1802
12
Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alright... I think I'm having another roadblock with the object/reference situation, but I'm not sure how to fix my syntax.... here's some code snippets.


and...


I also know that ArrayLists aren't IDEAL... but the use of an "ArrayList" is specifically asked for in this project.

The problem is I'm getting 2 compiler errors....
  • 1: line 28 createScore cannot be applied to Arraylist
    2: a warning about unchecked/unsafe operations in QuizGrader.


  • I think #1 has to do with me trying to send the ArrayList references to the ScoreIt class. Alright, I'm positive it does.... but what am I doing wrong??

    ... and I really thought I had it.
    --Janeice
     
    Fred Hamilton
    Ranch Hand
    Posts: 684
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I would say the object named key needs to be of the same type as the first parameter of method createScore()
     
    Janeice DelVecchio
    Saloon Keeper
    Posts: 1802
    12
    Eclipse IDE Java Windows
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Fred Hamilton wrote:I would say the object named key needs to be of the same type as the firt paramter of createScore()


    Good to see you here again, Fred.....


    Lemme try that.....

    Whoppee!! I have some other issues, but this fixes my main issue.

    Guess I was closer than I thought.
    Thanks!
    /JD/
     
    Dan Walin
    Ranch Hand
    Posts: 109
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I agree. I always need to see examples to really "get it". I just wanted to point out he importance of the deeper understanding because I have seen some coworkers who took short cuts, slapped something together that worked just fine - until problems start. Then they waste so much time not really knowing what to look for to fix the problem because they never really understood their own code.
     
    I agree. Here's the link: http://aspose.com/file-tools
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic