1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Dmitry_Shevchenko [17]
2 years ago
7

what is wrong with the following code? string s; system.out.println(s); group of answer choices the line, string s;, will cause

an error. system.out.println should be replaced with system.output.println you cannot print a string without setting its value. the line, system.out.println(s); should use a scanner. variables cannot be printed.
Computers and Technology
1 answer:
hodyreva [135]2 years ago
3 0

The error in your Java program is described as follows:

You cannot print a string without setting its value.

<h3>How to print a string in Java?</h3>

There are multiple ways to print a string in a Java, but one of them is using the system.out.println(string) command, which prints the string and gives a new line.

However, for this method, and any other, the string has to be set before it is printed, which does not happen for this problem. There should be a line setting the string like the example:

s = "ABC";

Hence the correct option regarding the error is given as follows:

You cannot print a string without setting its value.

More can be learned about Java programming at brainly.com/question/18554491

#SPJ1

You might be interested in
How many passes will it take to find the four in this list?
earnstyle [38]

Answer:

3 is the correct answer

I got correct on my test

7 0
3 years ago
Read 2 more answers
Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integer
oksano4ka [1.4K]

Answer:

The program in Python is as follows:

def get_user_values():

   user_values = []

   n = int(input())

   for i in range(n+1):

       inp = int(input())

       user_values.append(inp)

   output_ints_less_than_or_equal_to_threshold(user_values,user_values[n])

def output_ints_less_than_or_equal_to_threshold(user_values, upper_threshold):

   for i in user_values:

       if i <= upper_threshold:

           print(i,end=" ")

           

get_user_values()

Explanation:

This defins the get_user_values() method; it receives no parameter

def get_user_values():

This initializes user_values list

   user_values = []

This gets the number of inputs

   n = int(input())

This loop is repeated n+1 times to get all inputs and the upper threshold

<em>    for i in range(n+1):</em>

<em>        inp = int(input())</em>

<em>        user_values.append(inp)</em>

This passes the list and the upper threshold to the output..... list  output_ints_less_than_or_equal_to_threshold(user_values,user_values[n])

This defines the output.... list

def output_ints_less_than_or_equal_to_threshold(user_values, upper_threshold):

This iterates through the list

   for i in user_values:

If current element is less or equal to the upper threshold, the element is printed

<em>        if i <= upper_threshold:</em>

<em>            print(i,end=" ")</em>

The main method begins here where the get_user_values() method is called

get_user_values()

7 0
3 years ago
What is the ghosted text or picture behind the content on the page?​
Svetach [21]

Answer:

Watermark

Explanation:

This is actually called a Watermark. It is usually used as a way of showing the name or logo of the author who owns the content that is underneath the watermark. This is done so that individuals cannot steal the owner's work and use it as their own. Usually, the owner has the original version of the content without any watermark, as well as individuals that have purchased the content or a licence to use the content for personal or commercial usage.

3 0
3 years ago
Timing can be a major factor in the success of a business incorporation and emerging technology. Describe one potential problem
Serga [27]
The price could go up, it might not work then later down the road
5 0
3 years ago
Read 2 more answers
Now the y0utube home screen is gone
erik [133]

Answer:

oh no thanks not good

Explanation:

did you try it on a different device mabye a phone

7 0
3 years ago
Read 2 more answers
Other questions:
  • Very large and very small numbers are easier to write in scientific notation. For example, the number, 0.000000728 would be writ
    7·1 answer
  • Which of the following is an example of a consumer service? computer builder motorcycle manufacturer cabinet maker air condition
    15·2 answers
  • Using the bitwise AND operation, the result of 1 AND 0 is ___________. 10100100 ___________ 11010101 = 01110001. A common way to
    15·1 answer
  • Which of the following menu commands would you select to make a copy of an open file and rename it?
    15·1 answer
  • \Read the sentence.
    12·1 answer
  • _____ is the widely used transport layer protocol that most Internet applications use with Internet Protocol (IP).
    9·1 answer
  • A project manager type a document and print it he is using
    14·1 answer
  • A __________ is a thorough examination of each aspect of a network to determine how it may be compromised.
    13·1 answer
  • Differentiate between patent and copyright.
    6·2 answers
  • How do you delete questions you asked?
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!