0

I have created a class with Array Lists in Blue J for my assignment and it compiles but I don't know how to test it. What do I have to type(parameter?) in method call for a method such as

public void addJob(Job job) 

public boolean runJob()

I understand that for int I just have to type numbers such as 2, and String "B".

1 Answer 1

3

Firstly you have to create an instance of your Job class and give it a name, e.g. job1. This can be done by right-clicking on the class and then clicking on new Job(). The resulting object will be listed in the box at the bottom of the BlueJ window and can be used in your BlueJ project.

Now call the method addJob(Job job) with job1 (just type in the name of the object, without quotes) as the parameter and your test should work.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.