Log In Register

Units

Unit: Arithmetic Operators - Questions and Answers

Practice these Arithmetic Operators under Java Programming walk-in interview Questions/ examination questions with best tricks and short cuts with solution. Student (candidate) who want to crack the walk in interview, competitive exams and want to find short cuts and tricks to solve questions on Arithmetic Operators for following purpose.

– Anyone who is wishing to increase their perfect knowledge of Arithmetic Operators of Java Programming.
– Anyone who is preparing for aptitude test and increase his in depth aptitude knowledge Java Programming specifically Arithmetic Operators.
– Anyone who is preparing for interviews (competitive examinations, govt examinations and bank examinations, off-campus or on campus interviews, walk-in interview and company interviews) having questions on Arithmetic Operators under Java Programming.

– Anyone who is preparing for aptitude test or competitive exam or entrance exam.
– Anyone who is preparing for entrance examinations and other competitive examinations.
– All Experienced, Freshers and Students.

Here is list of Questions and Answers covering all key area of  Arithmetic Operators topic of Java Programming:

1. With x = 0, which of the following are legal lines of Java code for changing the value of x to 1? 1. x++; 2. x = x + 1; 3. x += 1; 4. x =+ 1;

Answer: Option C

Explanation:
Operator ++ increases value of variable by 1. x = x + 1 can also be written in shorthand form as x += 1. Also x =+ 1 will set the value of x to 1.

2. Which of the following can be operands of arithmetic operators?

Answer: Option D

Explanation:
The operand of arithmetic operators can be any of numeric or character type, But not boolean.

3. Modulus operator, %, can be applied to which of these?

Answer: Option C

Explanation:
Modulus operator can be applied to both integers and floating point numbers. .

4. Which of these statements are incorrect?

Answer: Option D

Explanation:

5. Decrement operator, –, decreases value of variable by what number?

Answer: Option

Explanation: