Which two options, when inserted independently inside class Base…?

Given: Which two options, when inserted independently inside class Base, ensure that the
class is being properly encapsulated and allow the program to execute and print the square
of the number?

Given: Which two options, when inserted independently inside class Base, ensure that the
class is being properly encapsulated and allow the program to execute and print the square
of the number?

A.
protected int num;private int getNum() {return num;}public void setNum(int num)
{this.num = num;}

B.
protected int num;public int getNum() {return num;}public void setNum(int num)
{this.num = num;}

C.
private int num;public int getNum() {return num;}private void setNum(int num)
{this.num = num;}

D.
private int num;public int getNum() {return num;}public void setNum(int num)
{this.num = num;}

E.
public int num;protected public int getNum() {return num;}protected public void
setNum(int num) {this.num = num;}



Leave a Reply 0

Your email address will not be published. Required fields are marked *