setter

Dynamically assign to class

Here is what works: $some = new Something(); $some->user="username"; $some->password="password123"; i need: $some = new Something(); $some->user=$variable1; $some->user=$variable2; Please please, can i get quickest way to make it work ? Thanks! ...

Java setter, getter (rolling a die)

I have some questions about java. There are two questions in the code (I left them as comments). Also what is the purpose of using setting and getting methods? Could you please explain it very briefly. I am a beginner. Thank you :) public class Die { private final int MAX = 6; private int faceValue; public Die() { ...