Java Intermediate

0% completed

Previous
Next
Quiz
Question 1
Which of the following is an example of using this to return the current instance from a method?
A
return new this();
B
return this;
C
return this();
D
return super;
Question 2
Which of the following best describes a static method?
A
A method that can only be called on an instance of a class.
B
A method that is declared with the static keyword and can be called without creating an instance of the class.
C
A method that cannot access any variables.
D
A method that is inherited by all classes automatically.
Question 3
How do you call one constructor from another in the same class?
A
By using the super() keyword.
B
By using the new keyword.
C
By using the static keyword.
D
By using the this() keyword.

.....

.....

.....

Like the course? Get enrolled and start learning!
Previous
Next