Answer:
Let the two string type variables be var1 and var2. The value stored in these two variables is : The "use" of quotations causes difficulties.
- The variable which uses quoted string:
string var1 = "The \"use\" of quotations causes difficulties.";
- The variable which does not use quoted string:
string var2 = "The " + '\u0022' + "use" + '\u0022' + " of quotations causes difficulties.";
- Another way of assigning this value to the variable without using quoted string is to define a constant for the quotation marks:
const string quotation_mark = "\"";
string var2 = "The " + quotation_mark + "use" + quotation_mark + " of quotations causes difficulties.";
Explanation:
In order to print and view the output of the above statements WriteLine() method of the Console class can be used.
Console.WriteLine(var1);
Console.WriteLine(var2);
In the first statement escape sequence \" is used in order to print: The "use" of quotations causes difficulties. This escape sequence is used to insert two quotation marks in the string like that used in the beginning and end of the word use.
In the second statement '\u0022' is used as an alternative to the quoted string which is the Unicode character used for a quotation mark.
In the third statement a constant named quotation_mark is defined for quotation mark and is then used at each side of the use word to display it in double quotations in the output.
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.
Answer:
riodic Table
A museum wants to store their valuable documents in cases that contain a gas that will protect the documents.
She should not choose one of the other gases because they are too
The museum director should choose
Explanation:
I didn't understand
Answer:
B. THE LARGER THE NETWORK, THE MORE JOB LEADS AVAILABLE
Explanation:
- BECAUSE THATS MY ANSWER, AND IM CORRECT WITH THAT
<h2>
STUDY WELL</h2>