Answer:
space alignment
Explanation:
I'm not sure just taking a guess cuz I'm bored lol
Answer:
Option 2 i.e., instance methods is the correct answer to the following question.
Explanation:
Because the instance method or function is the function that needed the class object to be called.
<u>For Example:</u>
//header file
#include <iostream>
using namespace std;
//define class
class Test
{
public:
//instance method
void getins()
{
cout<<"I AM Instance method";
}
};
int main()
{
//creating object
Test obj;
//calling of instance method through class object
obj.getins();
}
<u>Output</u>:
I AM Instance method
Answer:
Did you mean layer 3 switch? Because a router always operates at layer 3
Explanation:
If the answer is yes, then a layer 3 is a switch that combines the functions of a switch and a router. So it is capable of operate layer 2 and layer 3. Some of its benefits are: Support routing between VLAN, decrease network latency because the packets don’t have to make extra hops to go through a router and reduce security management. But they are really expensive and lack of WAN functionality so they are used mostly for large intranet environments.
Answer:
public class Digits
{
public static boolean allDigitsOdd(int num)
{
boolean flag=true;
int rem;
while(num>0)
{
rem=num%10;
num=num/10;
if(rem%2==0) // if a even digit found immediately breaks out of loop
{
flag=false;
break;
}
}
return flag; //returns result
}
public static void main(String args[])
{
System.out.println(allDigitsOdd(1375)); //returns true as all are odd digits
}
}
OUTPUT :
true
Explanation:
Above program has 2 static methods inside a class Digits. Logic behind above function is that a number is divided by 10 until it is less than 0. Each time its remainder by 0 is checked if even immediately breaks out of the loop.
<span>Instance variables are declared private to prevent direct modification. Access to the variables is instead provided through methods. This practice is known as..
</span><span>c. encapsulation. It </span><span>is a mechanism of bundling the data (variables) and code acting on the data (methods) together as one.</span>