S
S
s892691835492017-02-27 18:29:05
Java
s89269183549, 2017-02-27 18:29:05

Why does the "variable already defined" error occur?

Write a program that prints the result for the expression 1 < a/10 || a < 2/3 + 1 for a values ​​of
123, 58, 0, -1, -0.443, 4, in turn. Run the program.

How can I make it so that a variable acan be assigned multiple values ​​in one block? If I start to override a, it says that the variable ais already defined in the method main. How to make this task in one block?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dimkss, 2017-11-28
@dimkss

Why do you need to redefine a?
Do you really need something like:
boolean bResult = 1 < a / 10 || a < 2/3 + 1; ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question