Answer:
- #include <iostream>
- using namespace std;
- class myinteger {
-
- private:
- int value;
-
- public:
- myinteger(int x){
- value = x;
- }
-
- int getValue(){
- return value;
- }
-
- };
- int main()
- {
- myinteger obj(4);
- cout<< obj.getValue();
- return 0;
- }
Explanation:
Firstly, we use class keyword to create a class named myinteger (Line 5). Define a private scope data field named value in integer type (Line 7 - 8).
Next, we proceed to define a constructor (Line 11 - 13) and a getter method for value (Line 15 -17) in public scope. The constructor will accept one input x and set it to data field, x. The getter method will return the data field x whenever it is called.
We test our class by creating an object from the class (Line 23) by passing a number of 4 as argument. And when we use the object to call the getValue method, 4 will be printed as output.
Forwarding table
However much we try to keep a routing table and a forwarding table in the same structure, there are several reasons to separate them. When forwarding a packet, a forwarding table is supposed to be structured to optimize the process of looking up an IP address while a routing table mostly focuses on calculating changes in topologies and including the IP address and the next hop device
Here you go. I added a constructor and a toString overload to make the object creation and printing as easy as possible.
public class student {
private String _id;
private String _name;
private String _address;
public student(String id, String name, String address) {
_id = id;
_name = name;
_address = address;
}
public String toString() {
return "Id: " + _id + "\nName: " + _name + "\nAddress: "+ _address;
}
public static void main(String[] args) {
student s1 = new student("S12345", "John Doe", "Some street");
System.out.println(s1);
}
}
Answer : Candice
Explanation: Candice penis fit in your mouth
00110001 00110100 00110000