Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Which of the following is a Java keyword? class < object variable method What en

ID: 3637968 • Letter: W

Question

Which of the following is a Java keyword?
class <
object
variable
method

What enables you to view the output of a Java program?

Javab
Javac
Java <
Javadoc

Which type of data type can be used for an identifier?

letters
numbers
special characters
all the above <

What are placeholders in Java?
identifiers
data types
variables <
keywords

What does intdata type represent?
integer <
char
string
double

You can create an object for which of the following?
class
interface <
variable
method

What does /*.....*/ represent?
single line comment <
multi-line comment

What will an interface have?
description of methods <
definition and declaration of methods
only declaration of methods
only variables

You include Methods inside a _______.
class
object <
interface
variable

For which of the following do you not need to create an object?
comments <
interface
static method
variables

Explanation / Answer

1) Which of the following is a Java keyword?

Answer: class


Only "class" is a keyword in Java.


2) What enables you to view the output of a Java program?

Answer: java


java is the Java application launcher;
javac is the Java compiler;
javadoc is the API documentation generator


3) Which type of data type can be used for an identifier?

Answer: All the above


An identifier can be composed of letters, numbers, and special characters (if your teacher defined them as '_' or '$')
Note: an identifier cannot start with a number!


4) What are placeholders in Java?

Answer: variables


Variables are used as a placeholder for different values
Generally speaking a placeholder means something else in Java.


5) What does int data type represent?

Answer: integer

an int represents a 32-bit integer in Java


6) You can create an object for which of the following?

Answer: Interface (this question is ambiguous)

You can create an object for a given class as well, that question is not very clear.


7) What does /*.....*/ represent?

Answer: multi-line comment

/* is the opening of a multi-line comment which spans until a */ is reached.
// is a single line comment


8) What will an interface have?

Answer: description of methods

An interface describes that kind of methods any class implementing it should have. No declarations are allowed.


9) You include Methods inside a _______.

Answer: class


You include methods inside a class, which is a blueprint for an object.
An object is just an instance of that class.


10) For which of the following do you not need to create an object?

Answer: static methods (and Comments! Duh)


Static methods should be invoked in a static way - without using an object but rather the class name.
Comments are for an obvious reason.


Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote