For Java True or False 1. You cannot create an equivalent loop using a for() sta
ID: 3596240 • Letter: F
Question
For Java
True or False
1. You cannot create an equivalent loop using a for() statement in place of a while() statement.
2. Only the Java Virtual Machine (JVM) needs to be specific to an operating system. All class code can be moved to a different system and still execute.
3. Java is an extension of HTML, as in JavaScript.
4. Return data types are not allowed for constructors, not even void.
5. In Java, the literal constant, 3.14159, would be stored as type float, just as with C/C++.
6. The default access specifier for a class is public.
Explanation / Answer
1. You cannot create an equivalent loop using a for() statement in place of a while() statement.
=> FALSE, any while loop can be coverted to for loop and vise versa
2. Only the Java Virtual Machine (JVM) needs to be specific to an operating system. All class code can be moved to a different system and still execute.
=> TRUE, any code running on one java compiler can run on another java compiler on other system
3. Java is an extension of HTML, as in JavaScript.
=> FALSE: Java is an object oriented language while HTML and javascript are markup language
4. Return data types are not allowed for constructors, not even void.
=> TRUE, a constructor does not have a return type
Constructor is internally a nonstatic method with name <init> and void return type
5. In Java, the literal constant, 3.14159, would be stored as type float, just as with C/C++.
=> TRUE, initialization is almost same, in C/C++ it is written as float f = 3.14159 and in java it is written as float f = 3.14159f;
6. The default access specifier for a class is public.
=> FALSE, For classes, and interface declarations, the default is package private.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.