No student devices needed. Know more
10 questions
How many constructors does this Java class have?
0
1
2
3
What is the job of a Java class's fields?
Used for communication with an object of this class type
Used for calculations when an object is constructed
Allows for import statements in this class
Store the state of an object of this class type
What of the following is the default value of an instance variable?
null
0
Depends upon the type of variable
Not assigned
Can we have multiple classes in same java file?
True
False
What is the return type of Constructors?
int
float
void
none of the mentioned
Which of this statement is incorrect?
All object of a class are allotted memory for the all the variables defined in the class
If a function is defined public it can be accessed by object of other class by inheritance.
main() method must be made public
All object of a class are allotted memory for the methods defined in the class
This is an example of a non-return method.
True
False
Write method header to Return a sales commission, given the sales amount and the commission rate
public static double getCommission(double salesAmount)
public static double getCommission(double salesAmount, double commissionRate)
double getCommission(double salesAmount, double commissionRate)
public static double(double salesAmount, double commissionRate)
Write method header to Return a square root of a number
public static void double sqrt(value)
public static void double sqrt(double value)
public static double sqrt(value)
public static double sqrt(double value)
The body of a method definition is contained within a set of ______________.
parentheses
rectangle brackets
curly braces
angle brackets
Explore all questions with a free account