Question
What are "getter" and "setter" methods primarily used
for in the context of encapsulation?Solution
Getters (accessors) provide read-only access to private fields, and setters (mutators) provide controlled write access. They act as public interfaces to manipulate the private data, allowing the class to enforce validation rules or other logic before data is read or modified.
How is O related to N’s brother?
How was G's father related to A's sister's mother
How is E related to F?
‘A # B’ means ‘A is the brother of B’.
‘A @ B’ means ‘A is the daughter of B’.
‘A & B’ means ‘A is the husband of B�...
Answer the questions based on the information given below.
‘L@M’ means ‘L is the father of M’.
‘L&M’ means ‘L is the siste...
If A is married to W, then how is W related to B?
In a family, B is the father of K. B has only two children. K is the brother of R. R is the daughter of P. A is the grand-daughter of P. S is the father...
How is K related to F?
Answer the questions based on the information given below.
There are seven members Q, R, S, T, U, V and W in a family of three generations. S i...
Pointing to Sushmita, a man said, 'She is the only daughter of my daughter's paternal grandmother How is that man related to Sushmita?