I. Given the following Java code fragment, what is output? int a, b; String c, d, e; String x = new String("I LOVE"); String y = "java!"; a = x.length( ); System.out.println("1) " + a); b = y.length( ); System.out.println("2) " + b); c = y.toUpperCase( ); System.out.println("3) " + c); d = x.toLowerCase( ); System.out.println("4) " + d); e = x.concat(y); System.out.println("5) " + e);

Answers

Answer 1
Answer:

Answer:

Output: The question segment gives the following output--

1) 6

2) 5

3) JAVA!  

4) i love

5) I LOVEjava!

Explanation:

  1. "1) 6" comes because "6" is the length of "I LOVE" which is the value of "x" variable and "x.length( )" statement gives the length of the value of "x" variable which is stored on "a" variable and "a" will be printed with "1)" symbol.
  2. "2) 5" comes because "5" is the length of "java!" which is the value of "y" variable and "y.length( )" statement gives the length of the value of "y" variable which is stored on "b" variable and "b" will be printed with "2)" symbol.
  3. "3) JAVA! " comes because "JAVA!" is the upper case letter of "java!" which is the value of "y" variable and "y.toUpperCase( )" statement change the value from lower case to uppercase of the value of "y" variable which is stored on "c" variable and "c" will be printed with "3)" symbol.
  4. "4) i love " comes because "i love" is the lower case letter of "I LOVE" which is the value of "x" variable and "x.toLowerCase( )" statement change the value from uppercase to lowercase of the value of "x" variable which is stored on "d" variable and "d" will be printed with "4)" symbol.
  5. "5) I LOVEjava! " comes because " I LOVEjava! " is the mixed value of the "x" and "y" variable. It prints because "x.concat(y);" statement combines the x and y value and stored in an "e" variable and "e" will be printed with "5)" symbol.

Related Questions

PowerPoint’s ____ feature allows you to set the timing for a video clip.
Which of the following is NOT a factor to consider when selecting the amount of life insurance to purchase?a. The amount of money your dependents would need to maintain their current lifestyle c. The amount of money needed to pay for burial costs and unpaid debts b. The ease with which you can adjust your policy d. Any additional sources of income that would be available to your dependents
The __________ is the system of official channels that carry organizationally approved messages and information.
When a summary slide is inserted into a presentation, where does it appear?a. After the active slide in the presentationb. After the first slide of the presentationc. At the beginning of the presentationd. At the end of the presentation
If the Spelling and Grammar checker suspects you have a misspelled word, it will _____.a. offer suggestions for the correct spelling b. pull up the Dictionary for you to search for the correct spelling c. supply you with Internet search results on the word d. automatically replace the word with the one it believes is correct

With "read" function, which one of the following statements is NOT correct? a.If the read is successful, the number of bytes read is returned. b.If the end of file is encountered, 0 is returned. c.The number of bytes actually read is always same as the amount requested for a successful read.d.The read operation starts at the file's current offset.e.Before a successful return, the offset is incremented by the number of bytes actually read

Answers

Answer:

a. If the read is successful, the number of bytes read is returned.

b. If the end of file is encountered, 0 is returned.

Explanation:

A read function is one of the functions used in computer programming. A read function is used to read an information or data that was written before into a file.

If any portion of a regular file before to the end of file has not been written and the end of file is encountered the read function will return the bytes with value 0.

If read function has read some data successfully, it returns the number of bytes it read.

Computer piracy occurs when what is violated

Answers

When intellectual property or copyright laws are violated. (Has to be with computer-related things)

Write the code for invoking a static method named sendDouble, provided by the DataTransmitter class. There is one double argument for this method. Assume that a double variable called x has already been declared and initialized to some value. Use this variable's value as an argument in your method invocation.

Answers

Answer:

The program to this question as follows:

Program:

public class DataTransmitter //defining class

{

double x=3.0; //define variable x.  

public static void sendDouble(double x) //define method sendDouble.

{

x=9.6; //change variable value

System.out.print("The value of x variable is :"+x); //print value.

}

public static void main(String[] args) //define main method

{

sendDouble(0.0); //calling function

}

}

Output:

The value of x variable is :9.6

Explanation:

The explanation of the above java program can be define as follows:

  • In the above java program a class is define that is "DataTransmitter" inside a class a double variable that is x is define which contain a double value that is "3.0".
  • In this class, a static method "sendDouble()" is defined. in the method, a double parameter is passed. inside a method, we change the variable value and print its value.
  • In main method is a sendDouble() function is called. In calling time a double value is passed in the function parameter.

Give three reasons why it is difficult to fight computer crime

Answers

Hackers have programs, sometimes teams, and usually advanced equipment.

All of the following are screen displays in Word EXCEPT:a. Full Screen Reading View
b. Margins View
c. Two Page View
d. Split View

Answers

All of the following are screen displays in Word EXCEPT: b.) MARGINS VIEW.

Margins is found in the page layout tab not in the view tab.

Aside from Full Screen Reading View, Two Page View, and Split View, screen displays in Word also includes Print Layout, Web Layout, Outline, and Draft.

What are the basic Mouse actions called and how are they executed

Answers

The left side is a shortcut for 'Enter' the small wheel in the middle is used to scroll your view of the object,The right is used to intialize options pop-up to edit or initiate commands of the intended target