Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Another Question - dang I'm dense

 
Richard Chambers
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Once again I'm trying to stuggle through a Java class with a don't want to be bothered instructor and a text book that shouldn't have been published. I'm having trouble grasping the concept of method declarations (probably advanced).

The scenario is I'm working with several files:

Test - that contains the main method
First
Second - that extends First
Third - provides access to Fourth
Fourth - a CSV file containing the data for the package

my question

How do I declare a method in Test that has methods in the other files as paramaters.

I'm having problems with the proper "formatting" for the parameters.
I thought it was on the lines of



but that's not working and the hundred or so other things I've tried ain't either. I know it's something simple, but I ain't seeing it.

Thanks
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I declare a method in Test that has methods in the other files as paramaters.

Wow, why are you doing this ? It reminds be of good old C programming. If you insist on doing it, you can declare your method this way :
.

But you'd better think twice
 
Richard Chambers
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Like I said, bad instructor with sorry text book
assignment makes ZERO sense for me.
He supplied some of the files and data, supposedly doing the background math for us, but the math is full of errors, I'm not sure he knows how to program.

The actual assignment instructions I'm hung up on are:

 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This private static method has no return value, and has three parameters: currentAccount of type CheckingAccount, myFile of type MyCsvFile and myFields of type String array.

Well, that makes sense. He is not asking you to pass methods, is he ?
You need to pass three arguments to a method called handleAccount, in the CheckingAccountsTest class
  • currentAccount of type CheckingAccount
  • myFile of type MyCsvFile
  • myFields of type String array


  • Let's say that you want a method whose argument is an int, you would write it :


    Then, try to think how you'd write a method with the three arguments listed above.

    assignment makes ZERO sense for me.

    keep cool, it will make sense when you figure out how to do it
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic