Skip to content
Advertisement

Tag: getter-setter

Eclipse says The constructor Email() is undefined

I am tring to expand on a tutorial I was following Java Project Step by step Build An Email Administration Application (https://www.youtube.com/watch?v=U3Ibvu0htNs&t=386s). I am trying to use getters and setters to allow the encapsulation to do its job, and eventually allow a user to enter their own name instead of having a preset name in the variable. I know the

Getter, Setter & NullPointerException

Firstly, I am trying to assign the value for array I initialized locally. The class type of the array is stored inside another class and the variable is private so I am using getter and setter to set the value. But it showing “Exception in thread “main” java.lang.NullPointerException at room.Test.main(Test.java:26)”, below is my code for the test.java: Below is the

Advertisement