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]
1 year 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]1 year 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
You can create a ____ partition to hold files that are created temporarily, such as files used for printing documents (spool fil
Lisa [10]
/var is the answer to then empty space
3 0
3 years ago
What is the difference between compliled and intebrated language?
Nady [450]

Answer:  

A compiled language is a programming language whose implementations are typically compilers and not interpreters. In this language, once the program is compiled it is expressed in the instructions of the target machine. There are at least two steps to get from source code to execution. While, an interpreted language is a programming language whose implementations execute instructions directly and freely, without previously compiling a program into machine-language instructions. While in this language, the instructions are not directly executed by the target machine. There is only one step to get from source code to execution.

I hope this helps.

3 0
2 years ago
Read 2 more answers
Input 3 positive integers from the terminal, determine if tlrey are valid sides of a triangle. If the sides do form a valid tria
butalik [34]

Answer:

In Python:

side1 = float(input("Side 1: "))

side2 = float(input("Side 2: "))

side3 = float(input("Side 3: "))

if side1>0 and side2>0 and side3>0:

   if side1+side2>=side3 and side2+side3>=side1 and side3+side1>=side2:

       if side1 == side2 == side3:

           print("Equilateral Triangle")

       elif side1 == side2 or side1 == side3 or side2 == side3:

           print("Isosceles Triangle")

       else:

           print("Scalene Triangle")

   else:

       print("Invalid Triangle")

else:

   print("Invalid Triangle")

Explanation:

The next three lines get the input of the sides of the triangle

<em>side1 = float(input("Side 1: ")) </em>

<em>side2 = float(input("Side 2: ")) </em>

<em>side3 = float(input("Side 3: ")) </em>

If all sides are positive

if side1>0 and side2>0 and side3>0:

Check if the sides are valid using the following condition

   if side1+side2>=side3 and side2+side3>=side1 and side3+side1>=side2:

Check if the triangle is equilateral

<em>        if side1 == side2 == side3: </em>

<em>            print("Equilateral Triangle") </em>

Check if the triangle is isosceles

<em>        elif side1 == side2 or side1 == side3 or side2 == side3: </em>

<em>            print("Isosceles Triangle") </em>

Otherwise, it is scalene

<em>        else: </em>

<em>            print("Scalene Triangle") </em>

Print invalid, if the sides do not make a valid triangle

<em>    else: </em>

<em>        print("Invalid Triangle") </em>

Print invalid, if the any of the sides are negative

<em>else: </em>

<em>    print("Invalid Triangle")</em>

4 0
3 years ago
Asking yourself questions can help you think of what to _____, in order to get answers.
Olenka [21]
Ask your self questions can help you think of what to measure, in order to get answers.
8 0
3 years ago
What is astronaut favourite key on keyboard? ​
Dennis_Churaev [7]

Answer:

The space bar is an astronauts favorite key

5 0
2 years ago
Read 2 more answers
Other questions:
  • Which one of the following features can control left and right indents on using markers
    8·1 answer
  • Easy question how the internet has impacted y’all life
    13·1 answer
  • What can you do to stop a computer from repeatedly restarting in a continuous loop?
    13·1 answer
  • What is the exact number of bits in a memory that contains (a) 128k bits?
    9·1 answer
  • Drag each label to the correct location on the image.
    10·1 answer
  • Which of the following was the name of the first generation of cell phone networks?
    14·1 answer
  • Write a program to calculate the area of a triangle whose base is 10cm and height is 6cm
    6·1 answer
  • What is the shortest, abbreviated version of the copy running-config startup-config command?
    6·1 answer
  • " In which software generation did the distinction between systems programmers and other programmers first surface?"
    15·1 answer
  • I have a question. This question will probably be deleted, but why do moderators keep deleting my answers when they are legitima
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!