Infosys interview question

Java Encapsulation, Access specifiers, Aggregation,composition,hooks in react?