Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

19/20 sem2 qn2 #570

Open
Mildred-ui opened this issue Nov 30, 2020 · 1 comment
Open

19/20 sem2 qn2 #570

Mildred-ui opened this issue Nov 30, 2020 · 1 comment
Labels
🖱️ Java General Questions with regards to Java or its API

Comments

@Mildred-ui
Copy link

Hi all!

Just want to clarify that for coding questions like this, do we have to ensure immutability? Also, in this particular case, should I decide what is the args takes in by Main? Or the question only need a structure?

Thx in adv :)

1

@Mildred-ui Mildred-ui added the 🖱️ Java General Questions with regards to Java or its API label Nov 30, 2020
@kieron560
Copy link

I believe for this question you just need to declare and construct the appropriate variables and structures to get the diagram shown. So the args taken in by Main for this question is not relevant. As for Immutability, I think it depends on the question haha, but for this case, you're referencing the same objects (Library's loan attribute uses bk and br directly), so immutability is not used here (you don't have to create a copy, which will add to the stack if I'm not wrong and that's not what the question wants). Once again, I think this depends on the question!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🖱️ Java General Questions with regards to Java or its API
Projects
None yet
Development

No branches or pull requests

2 participants