Airplane myPlane = new SonicJet(); Given the class hierarchy…

Airplane myPlane = new SonicJet(); Given the class hierarchy and code statement above, which of the following methods are allowed and are not allowed to be called on the myPlane variable? breakSoundBarrier() : move() : For each statement below, indicate which class provides the implementation of each of the methods called. myPlane.fly(); myPlane.toString();

Given the code below, what gets printed? Assume that Boo inh…

Given the code below, what gets printed? Assume that Boo inherits from an appropriate exception class. It is recommended that you trace this on scratch paper and look for your answer in the choices provided. public class Driver {     public static void main(String[] args) {         Boo booException = new Boo(“Boo Thrown”);        try {           throw booException;        } catch (Boo b) {           System.out.println(b.getMessage());         } catch (Exception e) {             System.out.println(“Exception Thrown”);         } finally {             System.out.println(“Is this printed?”);         }     } } 

Complete the main method below so that it reads in a file na…

Complete the main method below so that it reads in a file named FileIn.txt (assume this exists in the same directory where you are running your program). The method should output each line to another file named FileOut.txt that prefixes each EVEN line with “line X: “, where X is the line number (starting with 1). Look closely at the example output for more clarification. Notice that ALL lines are still printed to the output file. import java.io.*;import java.util.Scanner;public class FileIO { public static void main(String[] args) { /* Your implementation here */ }} Example input and output files: FileIn.txt FileOut.txt Hello world and hello once again  Hello line 2: world and hello line 4: once again    Make sure to select the ‘Preformatted’ style from the dropdown so your code is formatted clearly. DO NOT USE THE TAB KEY WHEN WRITING CODE AS YOU MAY ACCIDENTALLY SUBMIT YOUR EXAM. USE THE SPACE BAR INSTEAD.

Identify the Big-O (i.e. worst-case complexity) of each of t…

Identify the Big-O (i.e. worst-case complexity) of each of the following blocks of code (assume the “stuff” being done is some constant time). n is the input size: for(int i=0; i0; j–) {   // do some stuff…  }  for(int i=n; i>0; i=i/2) {   // do some stuff…  }  for(int i=n; i>=0; i–) {     // do some stuff…  }  for(int i=0; i