Question

Help with Java questions and please explain all your answers throughly.

The following three (3) questions are related. 12. Briefly deseribe the effect of the final modifer on methods. 13. Briefly describe the effect of the static modifier on methods. 14. Can a method be both final and static? Explain

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

Answer 12)
A method declared with final modifier can not be overridden in sub classes.


Answer 13)
A method declared with static modifier can be accessed using the class name and no instance variable is needed to access the method. Also since the static method is accessed using class name and not specific object, a static method can only access static class members(variables/ methods) and not instance members(variables/methods)

Answer 14)
A method can be declared with static and final modifiers. Such methods can not be overridden in subclasses


Answer for 15) needs more details on the assignment

Answer 16) False
The java.util.Map is not a sub-interface of java.util.Collection. A Collection is just a group of objects, whereas a map is a group of key-value pairs. So there is a mapping between key and values. A Collection does not have the concept of keys but only some values are stored in it. Hence the Map interface does not implement the Collection interface

Add a comment
Know the answer?
Add Answer to:
Help with Java questions and please explain all your answers throughly. The following three (3) questions...
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
  • would someone please kind enough to help me out on my intro to java study guide...

    would someone please kind enough to help me out on my intro to java study guide by helping me with some useful tips/ examples or anything on these questions. My grade is on the line and would really appreciate your help! Final exam study guide 13. truncating vs rounding - Where do you encounter truncation? Where do you encounter rounding? 14. Can you identify the following items in a Java source code example (using just syntax, usage, and naming convention)?...

  • PLEASE HELP WITH ALL QUESTIONS QUESTION 1 Distinguish or explain the difference between the following: 1.1...

    PLEASE HELP WITH ALL QUESTIONS QUESTION 1 Distinguish or explain the difference between the following: 1.1 Primary and secondary growth 1.2 Heartwood and sapwood 1.3 Simple and multiple fruits 1.4 Bottleneck effect and genetic effect QUESTION 2 2.1 Distinguish between annual, biennial and perennial plants. 2.2 Provide THREE examples of ways that humans use roots. 2.3 Is the following structures a root, stem or leaf and what is its function? a. Haustoria b. Rhizome c. Stipule spine (3 x 2...

  • JAVA Write a program which will read a text file into an ArrayList of Strings. Note...

    JAVA Write a program which will read a text file into an ArrayList of Strings. Note that the given data file (i.e., “sortedStrings.txt”) contains the words already sorted for your convenience. • Read a search key word (i.e., string) from the keyboard and use sequential and binary searches to check to see if the string is present as the instance of ArraryList. • Refer to “SearchInt.java” (given in “SearchString.zip”) and the following UML diagram for the details of required program...

  • Please briefly answer all the questions below ,and writing those more clearer and tidier (It is b...

    Please briefly answer all the questions below ,and writing those more clearer and tidier (It is best to use typing) This is a problem related to the spectroscopy. Please describe two different spectroscopic methods that use lasers as the light source. Applying conventional spectroscopy to nanoscale research usually suffers with low signal-to-noise ratio. Can you describe the practice(s) being used to overcome this difficulty and explain why it works?

  • Discussion Questions Your discussion question for this week's lab exercise deals with the three types of...

    Discussion Questions Your discussion question for this week's lab exercise deals with the three types of protein quantification methods discussed in this section. Though each method, Biuret reaction, BCA, and Bradford assays was briefly described, for your discussion question, compare and contrast in chemical detail the three methods. Explain if any the pros and cons of each method, and why a protein scientist would prefer one method to another. Finally, suggest and describe other types of protein quantification methods not...

  • please show all steps Fle Edit View Help Problem: 14 (of 29) Do not round interm Do not round intemediate answers. Give your final answer) to three decimal places. Check your units. The 13-m slend...

    please show all steps Fle Edit View Help Problem: 14 (of 29) Do not round interm Do not round intemediate answers. Give your final answer) to three decimal places. Check your units. The 13-m slender beam has a mass of 45 kg and is released from rest in the horizontal position with 0-0.If the static friction between the fixed support at O and the beam is 0.1, deternine the angle 0 at which slipping first occurs at O Does the...

  • Need help with a few questions! Using the JAVA language please. 1) exercises - branching Write...

    Need help with a few questions! Using the JAVA language please. 1) exercises - branching Write a method whatToWear(int temp) that takes a temperature and then outputs a string for what to wear in different weather conditions. There must be at least 3 categories. For example, whatToWear(90) might return “shorts” and whatToWear(30) might return “down coat” 2) Enum exercise • Define an enum Seasons, and rewrite the whatToWear method to use enums and switch statement 8) 2D array exercise 1....

  • Please explain clearly. Thank you for your time and help will upvote! 6. Suppose a Java...

    Please explain clearly. Thank you for your time and help will upvote! 6. Suppose a Java method receives a List<Integer> and reverses the order of the items it contains by removing each item from the front of the list and pushing it onto a Stack<Integer), and then popping the items from the stack and inserting each item to the end of the list. What is the expected Big- running time if: a. If an ArrayList is passed. Explain your answer....

  • I need this Program code made for Java please with the sample results. Echo Input from...

    I need this Program code made for Java please with the sample results. Echo Input from the Console to the Screen Using Methods Review the resources and instructions in the Discussion Prep Study before completing this discussion. For this discussion, you practiced using Java methods to echo input from the console to the screen. Create a Java program that reads in any value entered at the console and then prints it out to the screen. The program must have at...

  • PLEASE JUSTIFY YOUR ANSWERS TO THE QUESTIONS BELOW BRIEFLY DISCUSS WITH DIAGRAMS IF MORE CONVENIENT. 8.)...

    PLEASE JUSTIFY YOUR ANSWERS TO THE QUESTIONS BELOW BRIEFLY DISCUSS WITH DIAGRAMS IF MORE CONVENIENT. 8.) (a) Describe three vectors a, b and such that: (a) a+bwe and a+b=c Note that a, b and c are the magnitudes of vectors a, b and e, respectively. (b) Describe two vectors p and q such that: (b)p+q=p- (c) Describe three vectors r, s and t such that: r+s=t and +52 = 12 Note that r, s and t are the magnitudes of...

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