1.

I. Help Manish in identifying the incorrect variable name with justification from the following:i. [email protected]; ii. fee; iii. userid; iv. avg marks;II. Write Java code to declare a variable named Price of integer type. Assign a value 10 to this variable. Overwrite the value of price with its double value. Decrease the value of price by 5.

Answer»

I. (i) [email protected]; // Special symbols like "@" is not allowed in variable name

(iv) avg marks;// Spaces are not allowed in variable name

II.

int price;

price=10;

price=price*2;

price=price-5;



Discussion

No Comment Found

Related InterviewSolutions