Welcome to the CSC Q&A, where you can get help (and share your knowledge) about computer science!

Calling a method from a different class

+14 votes
For the BatchArtMaker, I am trying to call the method that I already made from the first part of the assignment, but everything I do keeps getting rejected by eclipse, or is adding things to the original assignment that makes that part not work correctly. I'm just really confused and have run out of ideas. Suggestions?

So far I have ArtMaker.makeArt(canvasPanel, inputFileName, numDotsWide, numDotsHigh, dotDiameter, shape);

but I don't get how to make the parameters all match.
asked Jan 16, 2016 in (Winter 15-16) by Taija Robinson (100 points)
edited Jan 16, 2016 by Taija Robinson

1 Answer

+4 votes

Yes, you should call ArtMaker.makeArt( ... ), but you do need to have the right parameters.

The trick is that you need to figure out all of the right actual parameters to give it.  You *DON'T* pass in the names of the formal parameters.  

And for BatchArtMaker, the user didn't provide a full filename for you.  You need to create your own filename (which is a String) to be "images/bird3.jpg", then "images/bird4.jpg", etc... and pass that in to the method.

answered Jan 16, 2016 by Forrest Stonedahl (100 points)