Aerosim Flight Academy Code About Introduction of Java Generic Type T HW http://deanzacollegecis.jenniferparrish.net/home/c…link for activity15.1 http:/

Aerosim Flight Academy Code About Introduction of Java Generic Type T HW http://deanzacollegecis.jenniferparrish.net/home/c…link for activity15.1

http://deanzacollegecis.jenniferparrish.net/home/c…link for activity16.1&16.2

Don't use plagiarized sources. Get Your Custom Essay on
Aerosim Flight Academy Code About Introduction of Java Generic Type T HW http://deanzacollegecis.jenniferparrish.net/home/c…link for activity15.1 http:/
For $10/Page 0nly
Order Essay

Answer the following review question from Lesson 15 by either typing directly into the textbox below or by uploading a document with your answers. Please include the question along with your answer to make your responses easy to read.

1.Rewrite the below class to make it store data of the generic type T:

public class Box {

private Candy contents1;

private Candy contents2;

private static int numBoxes = 0;

public Box() {

contents1 = null;

contents2 = null;

}

public Candy getContents1() {

return contents1;

}

public Candy getContents2() { return contents2;

}

public static int getNumBoxes() {

return numBoxes;

}

public void setContents1(Candy contents1) {

this.contents1 = contents1;

}

public void setContents2 (Candy contents2) {

this.contents2 = contents2;

}

public void updateNumBoxes() {

numBoxes++;

}

}

Answer the following review question from Lesson 16 by either typing directly into the textbox below or by uploading a document with your answers. Please include the question along with your answer to make your responses easy to read.

1. What will be the output of the below program if the user enters “two” for the numInParty?

import java.util.Scanner;
import java.util.InputMismatchException;

public class TestExceptions {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int numInParty = 0;
try {
System.out.print(“Welcome to Chez Yum Restaurant!”);
System.out.print(“Enter the number in your party: “);
numInParty = input.nextInt();
System.out.println(“We can seat ” + numInParty
+ ” people right away!”);
} catch(NullPointerException e) {
System.out.println( “Error! String is empty!”);
} catch(InputMismatchException e) {
System.out.println(“Please enter a number not text!”);
} finally {
System.out.println(“Thanks visiting Chez Yum!”);
}
}
}

I need activity 15.1 and answer about lesson 15 today within 5 hours.
And I will post lab 8 tomorrow. Lab 8 due at 6/6.

Calculator

Calculate the price of your paper

Total price:$26

Need a better grade?
We've got you covered.

Order your paper