The following java statement: double x; y; a. Declares two double variables x an
ID: 3837680 • Letter: T
Question
The following java statement: double x; y; a. Declares two double variables x and y b. Declares one double variable named x;y; c. Declares two double variables x and y with values 0 in each d. This is not a valid java statement. Enter (Squareroot) if the following is a valid Java statement or (X) if it is invalid 6. What will adults and children contain after executing this part of code: boolean grownUp = false; int adults = 22; int children = 12; if (grownUp) adults += 2; else children++; adults children What will x, y, and t contain after executing this part of code: string x = "ITBP" string y = "119"; String t = x; x = y; y = t; x y tExplanation / Answer
4. d. That is not a valid java statement. Since ; specifies the end of a statement
5. in String s should be in capital. (Wrong)
a variable name can start with $ or _. So, it is correct
bool is not a valid data type. It should be boolean. WRONG
variale name can't have super scripts. So, WRONG
Object should be declared usign CLASS_NAME object_name. So, WRONG
a variable name can start with $ and _. So CORRECT
variable name can't be a reserved keywork in java. else is reserved keywork. It is WRONG
6. Since the condition in the else will ge executed answer is
adults 22
children 13
7. Here strings x and y are getting swapped. SO, answer is x = "119"
y = ITBP
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.