0

this is code.

class Node {
private int number;
int lotto = 3;

    public Node(int number) {
        this.number = number;
    }
    
    public void setNumber(Node node) {
        this.number = node.number; // why? 
    }

}

why OOP allowed this situation? I'm curious about your opinions.

jihongkim
  • 11
  • 1
  • 1
    "Because the spec says so". If your question is specifically about 'okay, which part of the spec' - that doesn't feel like a stack overflow question (the JLS is right there, just go look it up, this is a developer help site, not 'how do I search the web for basic things'). If the question is 'why did the java spec authors decide to do this', that also isn't a question this site is for. – rzwitserloot Apr 29 '23 at 13:14

0 Answers0