Question

Question 4 2 pts What alterations, if any, would you need to make to your program if you added a method stub, void fly(); , tQuestion 2 2 pts What is the syntactically correct way to declare a method in an interface? o public void methodName(); O priQuestion 3 2 pts Using the solution designed in your lab, what is returned when map.get(forward) is called? Assume you have

0 0
Add a comment Improve this question Transcribed image text
Answer #1

ANSWER : HERE IS THE ANSWER FOR YOUR QUESTION:

----------------------------------------------------------------------------------------------------------------

Question 1) when we add any new method to a interface , its implementation is mandatory needed in the class that it implementing that interface .

thus , the correct option is  

d) ALL The classes that implement the class interface have to add the fly method()

Question 2)

method in a interface are always public and abstract by default . so if the programmer even forget to put public keyword, compiler would add it automatically . so the correct option is:

c) both void methodname() and public void methodname() are correct ;

Question 3)

map.get("forward") would get us a object related to forwardCommand as it is sensible logic writing to have key -value pair as name matching .

so the correct option would be:

d) A forwardCommand Object

----------------------------------------------------------------------------------------------------------------

I hope this would help you out.

If you like my answer , please upvote

If you have any doubt, you can provide comment /feedback below the answer

Thanks

Add a comment
Know the answer?
Add Answer to:
Question 4 2 pts What alterations, if any, would you need to make to your program...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Below is the code for the class shoppingList, I need to enhance it to accomplish the...

    Below is the code for the class shoppingList, I need to enhance it to accomplish the challenge level as stated in the description above. public class ShoppingList {   private java.util.Scanner scan; private String[] list; private int counter; public ShoppingList() { scan = new java.util.Scanner(System.in); list = new String[10]; counter = 0; } public boolean checkDuplicate(String item) { for(int i = 0; i < counter; i++) { if (list[i].equals(item)) return true; } return false; } public void printList() { System.out.println("Your shopping...

  • Please select correct option A,B,C,D Question 6 2 pts (TCO 4) What is the passive-interface command...

    Please select correct option A,B,C,D Question 6 2 pts (TCO 4) What is the passive-interface command that causes a router to stop sending what types of packets? Incoming O Hello O RIP Gateway

  • Consider the blowing code snippet Question 4 2 pts 2 pts Canvas XC Question 3 2...

    Consider the blowing code snippet Question 4 2 pts 2 pts Canvas XC Question 3 2 pts Consider the following code snippet public class Hypp extends Application public void start (Stage stapelt Button button new lutton("Calculate"); Label label new Label("Total amount dut) > public class Handler rolesents EventHandler Action vest public void handle (Actiontrent event) label.Text("Hell) > 2 What is wrong with this code? label must be declared as an instance variable. button must be declared as an instance variable...

  • Hey Guys , I need help with this assignment: This component of the final exam will...

    Hey Guys , I need help with this assignment: This component of the final exam will have two data structures. The two data structures will be a stack and the other will be a hashmap. The hashmap object will be added to the stack every time the user picks an answer. The hashmap will have a key and value. The key will be the timestamp (system time when the user selected a choice) and the value will be the choice...

  • Hello. I need help writing the following Java Program. Thank you Develop a class encapsulating the...

    Hello. I need help writing the following Java Program. Thank you Develop a class encapsulating the concept of a college course, assuming that a course has following attributers: code (for instance COSC1337), a description, and a number of credits (for instance 3). Include a constructor, the accessors, mutators and methods ‘toString’, ‘equals’, and ‘finalize’. Write a client class to test the behavior of the class and its methods. The outline of the class is given as follows: public class Course...

  • Question 216 pts (TCO 2) In order to guarantee that only one JRadioButton is selected at...

    Question 216 pts (TCO 2) In order to guarantee that only one JRadioButton is selected at any time, _____. add each JRadioButton object to a different panel create a ButtonGroup object and add the JRadioBttons to it have a JCheckBox object manage the three JRadioButtons This cannot be done in Java. Flag this Question Question 226 pts (TCO 2) Which Java interface would you need to implement in order to handle events such as key-pressed or key-released events? KeyListener interface...

  • Question 1 2 pts The preprocessor executes after the compiler. False True Question 2 2 pts...

    Question 1 2 pts The preprocessor executes after the compiler. False True Question 2 2 pts What code is human-readable and follows the standards of a programming language? Secret code Source code Key code None of these Machine code Question 3 2 pts What is the symbol that marks the beginning of a one line comment? Question 1 2 pts The preprocessor executes after the compiler. True False Question 5 2 pts A statement that may be used to stop...

  • What if you had to write a program that would keep track of a list of...

    What if you had to write a program that would keep track of a list of rectangles? This might be for a house painter to use in calculating square footage of walls that need paint, or for an advertising agency to keep track of the space available on billboards. The first step would be to define a class where one object represents one rectangle's length and width. Once we have class Rectangle, then we can make as many objects of...

  • need help on both of these. thank you for your help Question 4 1 pts A...

    need help on both of these. thank you for your help Question 4 1 pts A piece of equipment has an installed value of $200,000 with an estimated trade-in value of $50,000 after 15 years. Using DDB book depreciation determine the depreciation charge at year 12. Between $4,000-$6.000 0 Between $2.000-$4.000 Greater than $6,000 O Less than $2.000 D | Question 5 1 pts A company company can depreciate a piece of equipment using MACRS (5-year class) method. The book...

  • I need all 6 questions answered Question 1 2 pts Which of he following contraceptive methods...

    I need all 6 questions answered Question 1 2 pts Which of he following contraceptive methods provides protection against HIV transmission? O a copper IUD a latex condom a lamb intestine condom all of the above Question 2 2 pts The most effective method of hormonal contraception is: the etonogestrel implant injectable medroxyprogesterone acetate O a combination oral contraceptive the ethinyl estradiol/norelgestromin transdermal patch Question 3 2 pts How long is back-up contraception recommended for women starting a new method...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT