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
Nitella [24]
4 years ago
12

What is wrong with the following code? How should it be fixed?

Computers and Technology
1 answer:
krok68 [10]4 years ago
7 0

Answer:

Final variable x is not initialized.

Explanation:

In this JAVA code we have a final variable named x.The thing with final variable is that they act like constants in C++.Once initialized cannot be changed after that and we have to initialize them at the time of declaration.

In JAVA if we do not initialize the final variable the compiler will throw compile time error.Final variables are only initialized once.

You might be interested in
The number of protons plus the number of nuetrons equal the <br> A.atomic weight<br> B.atomic number
mash [69]
Atomic mass will be the answer according to your question .
For ex - atomic mass of oxygen is equal to 8+8 I.e. 16
Hope u understand by this
5 0
3 years ago
When a browser is open on your computer, what browser tool is used to move the webpage to the previously viewed page on the brow
ch4aika [34]

Answer:

back arrow button

Explanation:

7 0
3 years ago
What is one potential problem with the following loop? System.out.print("Enter integers. Enter -1 to exit."); System.out.println
iris [78.8K]

Answer:

The answer to this question can be given as  

The potential problem with the loop is it's counts when the user enters -1 from the keyboard, so the count will too many.

Explanation:

In the program there some line is missing. So the right program of the  question can be given as:  

import java.util.*;     //import package for take input from user.

public class Main     //define main class.

{

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

{

Scanner scan=new Scanner(System.in);          //creating object.

//print values.

System.out.print("Enter integers. Enter -1 to exit.");

System.out.println(" Count of integers entered will be returned.");  

 int n=0,c=0;           //declaring integer variable.

  while (n != -1)             //loop

   {

       n = scan.nextInt();               //take input by user and hold on variable n.  

       c++;

   }

 System.out.println(c);               //print value.

}

}

output:

Enter integers. Enter -1 to exit. Count of integers entered will be returned.

-1

1  

7 0
4 years ago
Which part of the water cycle is most affected by a sunny day with few clouds?
nirvana33 [79]
Increase in evaporation
8 0
3 years ago
Read 2 more answers
Using a Mouse
MariettaO [177]
I think it might be A. mouse sorry if I get it wrong tho hope it’s right.
7 0
3 years ago
Read 2 more answers
Other questions:
  • In what way, if any, are colleges and universities related?
    14·1 answer
  • Internet-filtering software that electronically blocks out websites in specific rating categories is called _____________ by tho
    9·1 answer
  • For this lab, youhave to write a programnamedseriesFunction.cthat prompts user to enter two values, x and n. Then it would use a
    11·1 answer
  • 1. Why was the Internet created?
    8·1 answer
  • Which of the following about Java arrays is true?
    14·1 answer
  • Word processing software, spreadsheet software, database software, and presentation software are examples of what category of co
    13·1 answer
  • D. Chipboard
    14·1 answer
  • Type the correct answer in each box. Spell all words correctly.
    12·1 answer
  • Please help i have 15 mins
    5·1 answer
  • Please describe the role of games in modern society!
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!