Consider the following class definitions. public class BClass { private int x; public void set(int a) { x = a; } public void pri
nt(){ } } public class DClass extends BClass { private int y; public void set(int a, int b) { //Postcondition: x = a; y = b; } public void print(){ } } Which of the following is the correct definition of the method set of the class DClass? (i) public void set(int a, int b) { super.set(a); y = b; } (ii) public void set(int a, int b) { x = a; y = b; }
The answer to the given question is the option "(i)".
Explanation:
In this question, the correct option is the "(i)" because In this method definition we use the super keyword. It refers to the parent's class. In this method, we use the superclass to call the above (parent) class method. and if we choose the option (ii), It will not call the parent class. That's why we use the option (i) which is correct.
FTP stands for file transfer protocol. FTP is used to transfer files between computers over the Internet. FTP servers can be setup to allow users to access the information anonymously or require registration for access.