Which code segment should you use?

You are developing an application to track project management for your company. The status of the
project is stored in a variable named percentComplete.
The method must execute only when percentComplete is equal to the numeric value 100.
You need to develop the application to meet the requirement.
Which code segment should you use?

You are developing an application to track project management for your company. The status of the
project is stored in a variable named percentComplete.
The method must execute only when percentComplete is equal to the numeric value 100.
You need to develop the application to meet the requirement.
Which code segment should you use?

A.
Option A

B.
Option B

C.
Option C

D.
Option D



Leave a Reply 4

Your email address will not be published. Required fields are marked *


Helpful_coder

Helpful_coder

Fairly certain the answer is E

Andy

Andy

single equal is for assignment, not comparison.

Lindokuhle

Lindokuhle

the correct answer is D, as === strictly compare

Question

Question

Compare without TYPE conversion! ‘===’.