Question: 3. (a) An important concept in Java programming is that of overloading. What do we mean by this term? In what situations is overloading a
3.
(a) An important concept in Java programming is that of overloading. What do we mean by this term? In what situations is overloading a useful programming strategy?
[10 marks]
(b) During the writing of a program, you are confronted with a coding problem very similar to one youve already solved in another part of the program. One way to take advantage of this is by pasting in the code you wrote previously. Comment on the viability of this strategy. If there is an alternative approach, explain what it is.
[10 marks]
(c) When you are reading code, you may come across use of a standard class that you have not encountered before. Describe where you need to look (e.g., online) to identify the ways in which the class can be used.
[10 marks]
(d) Variables are said to have both a scope and a lifetime. What do these terms mean and how do the concepts differ? Give an example to illustrate restriction of scope.
[10 marks]
(e) Explain one of the mechanisms that Java provides for enabling a program to be executed from the command line, as an application.
[10 marks]
3. (a) An important concept in Java programming is that of "overloading". What do we mean by this term? In what situations is overloading a useful programming strategy? [10 marks] (b) During the writing of a program, you are confronted with a coding problem very similar to one you've already solved in another part of the program. One way to take advantage of this is by pasting in the code you wrote previously. Comment on the viability of this strategy. If there is an alternative approach, explain what it is. [10 marks] (C) When you are reading code, you may come across use of a standard class that you have not encountered before. Describe where you need to look (e.g., online) to identify the ways in which the class can be used. [10 marks] (d) Variables are said to have both a scope and a lifetime. What do these terms mean and how do the concepts differ? Give an example to illustrate restriction of scope. [10 marks] (e) Explain one of the mechanisms that Java provides for enabling a program to be executed from the command line, as an application. [10 marks]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
