Complete question is attached as snapshot.
Answer:
This will result in a compilation error.
Here's the inheritance hierarchy:
Meg -> Lois -> Brian -> Stewie
Now Meg has 2 public Fxns, a() and toString().
Lois inherits from Meg and all its public functions as well but, overrides the a() fxn of its super class.
So finally Lois has fxns a(), b() and toString().
Brian extends Lois and inherits all the above listed fxns of Lois, but overrides the b() and toString() fxns.
Stewie extends Brian and inherits all the fxns of Brian, but overrides the a() and toString() fxns.
In the Main driver fxn, we call a() and b() methods of all these classes but, the base class Meg has no b() and it is not extending any class so its not available in its scope.
This results in a compilation error.
Explanation:
Answer: D. enter each major point from the outline on a separate line
Answer:
Booting
Explanation:
Booting is the process that occurs when you press the power button to turn your computer on. During this process (which may take a minute or two), the computer does several things: It runs tests to make sure everything is working correctly. It checks for new hardware.
Answer:
import java.util.*;
public class calcarms
{
public static void main(String [] args)
{
Scanner input = new Scanner(System.in);
//Declare Variable
int num;
//Initialize num to 0
num = 0;
//Print heading
System.out.println("Armstrong Numbers\t\tDifference between Successive Armstrong Numbers");
//Call Armstrong method
boolean result = Armstrong(num);
}
public static boolean Armstrong(int num)
{
int nums;
//Initialize old_Arms and new_Arms to 0
int old_Arms =0; int new_Arms = 0;
for(int i = 0;i<=500;i++) //Iterate from 0 to 500
{
nums = i;
int temp,calc = 0;
temp = nums;
//Check individual digit of each number
while(nums > 0)
{
int a=nums%10;
nums/=10;
calc+=(a*a*a);//Find cube of number
}
if(temp == calc) //Check if number is armstrong
{
new_Arms = calc;
old_Arms = new_Arms - old_Arms;
System.out.println(calc+"\t\t\t"+old_Arms);//Print
old_Arms = calc;
}
}
return true;
};
}
Explanation:
Comments are used to explain difficult lines