Question: Topic: Java Programming Hello, I have the following code attached below, and keep getting told that Television on the 23rd line cannot be resolved to

Topic: Java Programming

Hello,

I have the following code attached below, and keep getting told that "Television" on the 23rd line "cannot be resolved to a type". It happens on this line of code...

Television portable = new Television("Sharp", 19);

Can you tell me how to fix this?

Beginning of code...

import java.util.Scanner;

public class TelevisionDemo {

{}

public static void main(String[] args)

{

// //create a Scanner object to read from the keyboard

Scanner keyboard = new Scanner(System.in);

// //declare variables

int station; //the user's channel choice

// //HERE IS WHERE YOU DO TASK #5

Television portable = new Television("Sharp", 19);

portable.power();

System.out.println("A " + portable.getScreenSize() + " inch " +

portable.getManufacturer() + " has been turned on.");

System.out.print("What channel do you want? ");

station = keyboard.nextInt();

//change the channel on the television

portable.setChannel(station);

portable.decreaseVolume();

portable.decreaseVolume();

System.out.println("Channel: " + portable.getChannel() +

" Volume: " + portable.getVolume());

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!