Question
When designing a class, why is it generally a bad
practice to make all fields public?Solution
Making all fields public directly exposes the internal state of an object, breaking encapsulation. This allows external code to directly modify the data without any control or validation, making it difficult to maintain data integrity, track changes, and refactor the internal implementation without affecting client code.
- 741, 852, 1074, 1407, ?
82, 98, 130, 178, 242, ?
What will come in place of the question mark (?) in the following series?
75, 219, 388, ?, 809, 106513, 14, 23, 48, 97, 178, ?
What will come in place of the question mark (?) in the following series?
11, 13, 19, ?, 51, 81
Which of the following numbers will replace the question mark (?) in the given series?
17, 30, 44, 59, 75, ?
What will come in place of the question mark (?) in the following series?
9, 19, 41, 87, ?, 359
74, 84, 64, 104, ?, 184
114, 115, 118, 127, ?, 235
6, 30, 43, 58, 75, ?