What is the issue with this code

interface Box2{

static final int ITEM_CODE=201;

int method1();

double method2();
}

public class Window implements Box2{

public int method1(){

return ITEM_CODE;

}

}

public class myFrame{

public static void main(String args[]){

Window w = new Window();

System.out.println(w.method1());

}

}

A.
The interface should be declared as abstract.
B.
The class should be declared as abstract.
C.
The interface should have an implementation of method2.
D.
The class should have an implementation of method2.

Answers

Answer 1

Question: What is the issue with this code

interface Box2{

static final int ITEM_CODE=201;

int method1();

double method2();

public class Window implements Box2{

public int method1(){

return ITEM_CODE;

public class myFrame{

public static void main(String args[]){

Window w = new Window();

System.out.println(w.method1());

A. The interface should be declared as abstract.

B. The class should be declared as abstract.

C. The interface should have an implementation of method2.

D. The class should have an implementation of method2.

Answer: A The interface should be declared as abstract.


Related Questions

Which statement is true about asking questions while reading?
It is a system that keeps readers from understanding a text's purpose.
O It is a strategy that readers use only when reading textbooks.
O It is a system that strong readers do not use.
O It is a strategy that helps people be active readers.

Answers

Answer:

It is a strategy that helps people be active readers.

Explanation: Poggers m8

Answer:

D

Explanation:

what is a document you can create with word processing software________?

Answers

Answer:

I think like Microsoft Word, Google Docs/Slides, or maybe other Microsoft writing services.

Explanation:

hope this helps!

This program outputs a downwards facing arrow composed of a rectangle and a right triangle. The arrow dimensions are defined by user specified arrow base height, arrow base width, and arrow head width.(1) Modify the given program to use a loop to output an arrow base of height arrowBaseHeight. (1 pt)(2) Modify the given program to use a loop to output an arrow base of width arrowBaseWidth. Use a nested loop in which the inner loop draws the *’s, and the outer loop iterates a number of times equal to the height of the arrow base. (1 pt)(3) Modify the given program to use a loop to output an arrow head of width arrowHeadWidth. Use a nested loop in which the inner loop draws the *’s, and the outer loop iterates a number of times equal to the height of the arrow head. (2 pts)(4) Modify the given program to only accept an arrow head width that is larger than the arrow base width. Use a loop to continue prompting the user for an arrow head width until the value is larger than the arrow b

Answers

Answer:

Here is the JAVA program:

import java.util.Scanner; // to get input from user  

public class DrawHalfArrow{ // start of the class half arrow  

public static void main(String[] args) { // starts of main() function body  

   Scanner scnr = new Scanner(System.in); //reads input  

int arrowBaseHeight = 0; // stores the height of arrow base  

int arrowBaseWidth  = 0; // holds width of arrow base  

int arrowHeadWidth = 0; // contains the width of arrow head  

// prompts the user to enter arrow base height, width and arrow head width  

System.out.println("Enter arrow base height: ");  

arrowBaseHeight = scnr.nextInt(); // scans and reads the input as int  

System.out.println("Enter arrow base width: ");  

arrowBaseWidth = scnr.nextInt();  

/* while loop to continue asking user for an arrow head width until the value entered is greater than the value of arrow base width */  

while (arrowHeadWidth <= arrowBaseWidth) {  

   System.out.println("Enter arrow head width: ");  

   arrowHeadWidth = scnr.nextInt(); }  

//start of the nested loop  

//outer loop iterates a number of times equal to the height of the arrow base  

for (int i = 0; i < arrowBaseHeight; i++) {  

//inner loop prints the stars asterisks  

     for (int j = 0; j <arrowBaseWidth; j++) {  

         System.out.print("*");        } //displays stars  

         System.out.println();          }  

//temporary variable to hold arrowhead width value  

int k = arrowHeadWidth;  

//outer loop to iterate no of times equal to the height of the arrow head  

for (int i = 1; i <= arrowHeadWidth; i++)  

{     for(int j = k; j > 0; j--)     {//inner loop to print stars  

      System.out.print("*");    } //displays stars  

  k = k - 1;  

  System.out.println(); } } } // continues to add more asterisks for new line  

Explanation:  

The program asks to enter the height of the arrow base, width of the arrow base and the width of arrow head. When asking to enter the width of the arrow head, a condition is checked that the arrow head width arrowHeadWidth should be less than or equal to width of arrow base arrowBaseWidth. The while loop keeps iterating until the user enters the arrow head width larger than the value of arrow base width.  

The loop is used to output an arrow base of height arrowBaseHeight. So point (1) is satisfied.  

The nested loop is being used which as a whole outputs an arrow base of width arrowBaseWidth. The inner loop draws the stars and forms the base width of the arrow, and the outer loop iterates a number of times equal to the height of the arrow. So (2) is satisfied.  

A temporary variable k is used to hold the original value of arrowHeadWidth so that it keeps safe when modification is done.  

The last nested loop is used to output an arrow head of width arrowHeadWidth. The inner loop forms the arrow head and prints the stars needed to form an arrow head. So (3) is satisfied.  

The value of temporary variable k is decreased by 1 so the next time it enters  the nested for loop it will be one asterisk lesser.  

The screenshot of output is attached.

Do the binary numbers 001101 and 00001101 have the same value or different values

Answers

Answer:

Yes, the both have the same value.

Explanation:

This is the answer because:

001101 = 13

00001101 = 13

Hope this helps! :D

When was JavaScript founded?
Write in this format:
mm/yy

Answers

Answer:

It was founded in 09/95

Explanation:

Answer: 09/1995

JavaScript was founded in the September of 1995, in early fall. It is a very common dynamic computer programming language.

I wrote the answer in mm/yy format, so this answer should meet the requirements.

Hope this helps! Best of Luck!

when four consecutive numbers are added the sum is 46 find the integers plss anyone help me​

Answers

Answer:

The integers are 10,11,12,13

Explanation:

At first form an equation,

Let,

x = first number

x + x+1 + x+2 + x+3 = 46

Now solve the equation and youll get the answer,

x=10

For the other numbers,

x+1=11

x+2 = 12

x+3 = 13

does anyone or has anyone ever done it?? please help it’s for like skills!

Answers

Answer:

is this mathmatics

Explanation:

What does Tristan need to do to add a row at the bottom of the table shown?

He needs to put the insertion point at the end of 8.8 and press the Tab key.
He needs to put the insertion point at the end of 8.8 and press the Enter key.
He needs to put the insertion point at the end of freezers and press the Tab key.
He needs to put the insertion point at the end of freezers and press the Enter key.

Answers

Answer:

He needs to put the insertion point at the end of 8.8 and press the Tab key.

Explanation:

Answer:

A

Explanation:

Xcode, Swift, and Appy Pie are all tools for doing what? A: Writing code in Java. B: Creating smartphone apps. C: Creating apps to run on a desktop or laptop. D: Writing code in C#​

Answers

Answer:

Creating smartphone apps

Explanation:

Took the test, got 100, read the lesson on slide 3 towards the bottom

I don't even understand what I'm supposed to do.

Assignment/ Question
Alex is the new office manager at a small advertising firm. One responsibility is to manage the technology being used by the employees. However, it turns out that they have been using outdated software and could use some upgrades! Before launching a campaign to modernize the office software, Alex needs to know exactly what kinds of software to recommend, so a survey will be distributed to find out what common file types the employees use. Please help by explaining what a file type is, what the different kinds are, and what each one does best. Write a paragraph of at least five sentences that Alex can include at the top of the survey.
Alex collects the survey sheets and combines the results. Now your expertise is needed! Please fill out the file content that matches the file type, as well as recommending a particular piece of software.

Answers

Answer:

i tried but i can figure it out

Answer:

You have to fill into the table what the file type and recommendations are (for example, .xls is a spreadsheet and Excel is the software is the recommendation).  Hope that helps a bit!

Explanation:

Which guidelines should be used to make formatting tasks more efficient?

Use pasted text only; this does not keep the original formatting.
Keep formatting fancy; this makes Word documents look better.
Save styles in the document; this makes working with multiple documents easier.
Avoid pasting text from other documents; this makes formatting easier.

Answers

Answer:

Use pasted text only; this does not keep the original formatting.

Explanation:

bc

Answer:

Use pasted text only; this does not keep the original formatting.

Explanation:

how can parents be health educators in family​

Answers

Answer:

They can be health educators in family because they are your parents.

Explanation:

The reason why is because since they are your parents that means they have kids, so they probably know the ins and outs of parenting and running a family.

Each Main Tab in the Ribbon has different Groups containing icons.
True Or False

Answers

Answer:

i think true

Explanation:

What is constructive criticism?

Advice and possible solutions intended to help or improve something
Information given to others as a way to make them feel unintelligent
Reports about decreasing profits
Statements and no possible solutions aimed at showing problem areas

Answers

Answer:

Constructive cristsism is a helpful way of giving feedback that provides specific, actionable suggestions. Or, its a nice way of criticizing someone and telling them what to do better

Answer:

Advice and possible solutions intended to help or improve something

Explanation:

I took the test and Got it Correct!

What is the technical term of a native programming language?​

Answers

Native Code Or Machine Language

How do I turn off lanschool student?

Answers

Answer:

First try logging out. If that doesn't work there is a really helpful video on how to uninstall and reinstall with everything still there. Hope this was helpful.

I need to know how to input this into python on zybooks. I've been stuck on this for days and I keep running into "invalid syntax" or "unknown word red" Summary: Given integer values for red, green, and blue, subtract the gray from each value. Computers represent color by combining the sub-colors red, green, and blue (rgb). Each sub-color's value can range from 0 to 255. Thus (255, 0, 0) is bright red, (130, 0, 130) is a medium purple, (0, 0, 0) is black, (255, 255, 255) is white, and (40, 40, 40) is a dark gray. (130, 50, 130) is a faded purple, due to the (50, 50, 50) gray part. (In other words, equal amounts of red, green, blue yield gray). Given values for red, green, and blue, remove the gray part. Ex: If the input is 130 50 130, the output is: 80 0 80 Find the smallest value, and then subtract it from all three values, thus removing the gray.

Answers

Answer:

Here is the C++ program:  

#include <iostream>   //to use input output functions  

using namespace std;   //to identify objects cin cout  

int main() {   //start of main method  

int red,green,blue,smallest;   //declare variables to store integer values of red,green, blue and to store the smallest value  

cout<<"Enter value for red: ";  //prompts user to enter value for red  

cin>>red;  //reads value for red from user  

cout<<"Enter value for green: ";  //prompts user to enter value for green  

cin>>green;  //reads value for green from user  

cout<<"Enter value for blue: "; //prompts user to enter value for blue  

cin>>blue;   //reads value for blue from user  

//computes the smallest value

if(red<green && red<blue) //if red value is less than green and blue values  

smallest=red;   //red is the smallest so assign value of red to smallest  

else if(green<blue)   //if green value is less than blue value  

smallest=green;   //green is the smallest so assign value of green to smallest  

else  //this means blue is the smallest  

smallest=blue;  //assign value of blue to smallest  

//removes gray part by subtracting smallest from rgb  

red=red-smallest;  //subtract smallest from red  

green=green-smallest;  //subtract smallest from green  

blue=blue-smallest;  //subtract smallest from blue  

cout<<"red after removing gray part: "<<red<<endl;  //displays amount of red after removing gray  

cout<<"green after removing gray part: "<<green<<endl;  //displays amount of green after removing gray

cout<<"blue after removing gray part: "<<blue<<endl;  } //displays amount of blue after removing gray  

Explanation:

I will explain the program using an example.  

Lets say user enter 130 as value for red, 50 for green and 130 for blue. So

red = 130  

green = 50  

blue = 130  

First if condition if(red<green && red<blue)   checks if value of red is less than green and blue. Since red=130 so this condition evaluate to false and the program moves to the else if part else if(green<blue) which checks if green is less than blue. This condition evaluates to true as green=50 and blue = 130 so green is less than blue. Hence the body of this else if executes which has the statement: smallest=green;  so the smallest it set to green value.  

smallest = 50  

Now the statement: red=red-smallest; becomes:  

red = 130 - 50  

red = 80  

the statement: green=green-smallest;  becomes:  

green = 50 - 50  

green = 0  

the statement: blue=blue-smallest; becomes:  

blue = 130 - 50  

blue = 80  

So the output of the entire program is:  

red after removing gray part: 80                                                                                                 green after removing gray part: 0                                                                                                blue after removing gray part: 80  

The screenshot of the program along with its output is attached.

What type of data is the result of each of the following lines of code?
str(2.34)

int('2')

float(2)

Answers

Answer:

snag

Explanation:

how do you award a brainliest

Answers

Answer: Usually there has to be 2 answers. When you go to the answers on your question there should be a outlined crown or something like that, then you click that.

Which of the following are signatures for constructors in the Rectangle class?

----Choose all options that apply.-----


A. Rectangle(double len1, double len2, double len3, double len4)

B. Rectangle(double len)

C. Rectangle(int len)

D. Rectangle(int len, int wid)

E. Rectangle()

F. Rectangle(double len, double wid)

Answers

Answer to this answer is B because

constructor is a special method that's also called once memory is allocated for a freshly constructed object to initialize it, and further  discussion can be defined as follows:

It has the same identity as the class or struct, so it normally sets up the new object's data members.In the Rectangle class if it calculates the area. so, it takes two parameters that are "length, width", that is equal to "Rectangle(int len, int wid)".

Therefore, the final answer "Option D".

Learn more:

brainly.com/question/14239397

Which utility causes the computer to run slow? defragmentation utility OR compression utility?

Answers

Answer:

compression

Explanation:

Assignment: Earth’s Surface Exploration

Answers

Answer:

Stop waiting until the due date

Explanation:

Why you always wait until the last minute to turn in yo assignments

Y’all know any movie sites I can go on?

Answers

Answer:

Tinseltown

Explanation:

Unscramble the words

A: ESUOM RETUPOC

B: KSID EVIRD

Answers

A. Mouse coputer
B. Disk drive
A) Mouse copter
B) Disk Drive
hope this helps x

Often used in connection with a business
A: fair use
B: copy right
C: public domain
D: commercial use
E: Creative Commons

Answers

Answer:

I would have to say public domain (but i am not sure)

What is the singular of Data?
What are alphanumeric characters?

Answers

Answer:

1. Datum

2. Alphanumericals are a combination of alphabetical and numerical characters

Explanation:

IT professionals should help to protect users’ personal information, such as bank account information or Social Security numbers, to prevent

A.software piracy.

B.identity theft.

C.moonlighting.

D.corporate espionage.

Answers

Answer:

B

Explanation:

Answer:

b

Explanation:

When would you use database software instead of spreadsheet or word processing software?​

Answers

Answer: When I need to see table relationships and sort data by custom fields.

Explanation:

Answer: When I need to see table relationships and sort data by custom fields.

Explanation: took the quiz


2 A_______
uses graphics or pictures to help the user navigate and
access programs

Answers

Answer:

the interface

Explanation:

Write a program Gas.java that computes and displays the price a person will pay for gas at the gas station. The program takes three command-line arguments: two double arguments referring to the price per gallon, and the number of gallons of gas, and one boolean argument referring to whether the person pays cash or credit (true for cash, false for credit). If the person pays with a credit card, there is an extra charge of 10% of the total price. Gas is never free. A person stopping to buy gas will always buy some amount of gas. Print the error message "Illegal input" if any of the double inputs is zero or negative, and end the program.

Answers

Answer:

double price, number, total;

boolean payment;

Scanner input = new Scanner(System.in);

System.out.print("Enter Amount of Gas: ");

price = input.nextDouble();

I've added the full source file as an attachment.

Where I used comments to explain difficult line

Explanation:

Other Questions
Calculating Rate of change Write as a product:25a^20.01b^10 Complete with wish or if only. (2 pts)1.I . you were here.2. you were here.3. they werent so silly.4.She . she could buy a phone. PLEASE HELP ASAP!!!!!Which type of therapy seeks to improve relationships among related people?A. individual therapyB. group therapyC. family therapyD. professional therapy The following balance sheet for the Hubbard Corporation was prepared by the company:HUBBARD CORPORATIONBalance SheetAt December 31, 2016 AssetsBuildings $760,000 Land 280,000 Cash 70,000 Accounts receivable (net) 140,000 Inventories 260,000 Machinery 290,000 Patent (net) 110,000 Investment in marketable equity securities 80,000 Total assets $1,990,000 Liabilities and Shareholders' EquityAccounts payable $225,000 Accumulated depreciation 265,000 Notes payable 520,000 Appreciation of inventories 90,000 Common stock, authorized and issued110,000 shares of no par stock 440,000 Retained earnings 450,000 Total liabilities and shareholders' equity $1,990,000 Additional information:1. The buildings, land, and machinery are all stated at cost except for a parcel of land that the company is holding for future sale. The land originally cost $60,000 but, due to a significant increase in market value, is listed at $140,000. The increase in the land account was credited to retained earnings.2. Marketable equity securities consist of stocks of other corporations and are recorded at cost, $30,000 of which will be sold in the coming year. The remainder will be held indefinitely.3. Notes payable are all long-term. However, a $200,000 note requires an installment payment of $50,000 due in the coming year.4. Inventories are recorded at current resale value. The original cost of the inventories is $170,000.Required:Prepare a corrected classified balance sheet for the Hubbard Corporation at December 31, 2016. is the hand backwards asking before i finish it Compute the number of kilograms of hydrogen that pass per hour through a 5-mm-thick sheet of palladium having an area of 0.20 m^2 at 500C. Assume a diffusion coefficient of 1.0 x 10^8 m^2 /s, that the concentrations at the high- and low-pressure sides of the plate are 2.4 and 0.6 kg of hydrogen per cubic meter of palladium, and that steady-state conditions have been attained. A power given only to the Federal Government, such as coining money:Concurrent PowerbNone of thesecDelegated Power dReserved Power . Unlike animal cells, plant cells have ________________, a large central_____________, and a _________ wall. Identify three events that eventually led to the decline of feudalism. Briefly explain how each weakened the feudal system.Text to speech You start at (0, -2). You move down 3 units. Where do you end? What is the point of having an armature before you add clay or plaster? Escribe un informe de tu libro / novela favorito en espanol. Asegrese de utilizar estas palabras de vocabulario en su informe: emocionante, triste, divertido, serio. Asegrese de que el informe de su libro tenga al menos 3 prrafos, uno para el comienzo de la historia, uno para el medio y otro para el final. Tenga el ttulo y el autor de su libro en la parte superior de su pgina. (50 puntos) Which function represents g(x), a reflection of f(x) = 4(one-half) Superscript x across the x-axis? Set to launch in October of 2018, the James Webb Space Telescope (JWST) is NASAs successor to the Hubble Space Telescope (HST) now orbiting Earth. The capability of the Hubble to take clear images into deep space has provided astronomers some of the most highly detailed observations into space and time. Using primarily infrared vision, the James Webb can look further into space than the Hubble, which observes using primarily the ultraviolet part of the electromagnetic spectrum.The electromagnetic spectrum is a range of electromagnetic waves. Visible colors, the colors of the rainbow, are a very small part of this spectrum. Ultraviolet waves are smaller waves than visible color and infrared are larger waves. It is an advantage for the James Webb Telescope to use infrared waves to observe because most stars and planets hide behind cocoons of dust that make them difficult to see with visible light. Infrared can penetrate these dusty clouds revealing the secrets behind them.-Excerpted from "Looking Into the Infinite" by S.P. Ace CadetWhich evidence is best for supporting the claim that the James Webb can look further into space than the Hubble?A. The Hubble Space Telescope allows us to make detailed observations of space and time.B. Visible colors, the colors of the rainbow, are a very small part of the electromagnetic spectrum.C. Ultraviolet waves have a smaller wavelength than visible light.D. Infrared waves can penetrate clouds of dust to observe stars and planets. Please help brainiest! 2. Whyare animals phalanges fusedtogether? Select the TWO correct statements below regarding the twographs above. Take your time to get both right so you get this 4point question correct.SELECT ALL THAT APPLYThe graph on the left is called anexponential curve.The curve on the right is called a J-curve.Time is plotted on the x-axis.The graph on the right is the onlypopulation growth model what are the underlying epic themes in Beowulf . The psychology club is having a self-proclaimed psychic come to their campus fund-raising event to demonstrate his abilities. He charges $200 for these events, and the club is charging $1.50 for tickets with a chance to have the psychic read the ticket holders mind.How much would the club gain or lose by selling 125 tickets?and will The club will gain or lose?