Answer:
Type of myDisk.brand is BrandInfo.
Explanation:
Answer:Interface segregation principle
Explanation: Interface-segregation principle (ISP) is amongst the major principles of the object-oriented design which describes that none of the users/clients can be forced for indulging and depending on the unknown methods or methods that they don't have knowledge about.
It functions by making the interfaces visible to the user that specifically fascinates them and keeping other smaller interfaces.Interfaces are made by splitting process and making the small interfaces from them.
Answer:
<u>Window.java</u>
- public class Window {
- int width;
- int height;
-
- public Window(int width, int height){
- this.width = width;
- this.height = height;
- }
- public int getWidth(){
- return width;
- }
- public int getHeight(){
- return height;
- }
-
- public int getClientAreaHeight(){
- return getHeight();
- }
- }
<u>Main.java</u>
- public class Main {
- public static void main (String [] args) {
- Window win1 = new Window(12, 15);
- System.out.println(win1.getClientAreaHeight());
- }
- }
Explanation:
<u>Window.java</u>
There is a Window class with two int type attributes, width and height (Line 1 - 3).
The constructor of this class will take two inputs, width and height and set these input to its attributes (Line 5 - 8). There are two methods getWidth and getHeight which will return the value of attributes width and height, respectively (Line 10 - 16).
The required new method getClientAreaHeight is defined in line 18 -20. This method will call the getHeight method to return the height value of the window (Line 19).
<u>Main.java</u>
We test the Window class by creating one Window instance and call the getClientAreaHeight method and print the return output (Line 1 -6).
We shall see 15 is printed.
Usually a Xeon is the fastest. Matters what time it was built and the chipset. If its old, the i7 is faster.
An optimization problem is one in which you want to find, not just a solution, but the best solution •<span>A <span>“greedy algorithm” sometimes works </span></span><span>well for optimization problems </span>•<span>But only a few optimization problems can </span><span> be solved by the <span>greedy method</span></span>