Java - Encapsulation
You want to create a class Student with a private variable grade that can only be set if the value is between 0 and 100. Which is the best way to implement this using encapsulation?
You want to create a class Student with a private variable grade that can only be set if the value is between 0 and 100. Which is the best way to implement this using encapsulation?
grade stays between 0 and 100.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions