Question 11
EasyWhat is instantiation?
- A.
Creating an object from a class
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Object-Oriented Programming
What is instantiation?
Creating an object from a class
Compiling a program
Deleting an object
Copying a class
Sign up free to see the answer and a step-by-step explanation.
What is a member of a class?
A field or method defined in the class
A file that uses the class
Any object of the class
A user of the program
Sign up free to see the answer and a step-by-step explanation.
In Python, what is the first parameter of an instance method conventionally named?
this
cls
me
self
Sign up free to see the answer and a step-by-step explanation.
What does a UML class diagram show?
The screens of an app
The network layout
Classes with their attributes, methods and the relationships between them
The order in which code runs
Sign up free to see the answer and a step-by-step explanation.
In Java, which method is called when an object is passed to System.out.println?
display()
toString()
print()
valueOf()
Sign up free to see the answer and a step-by-step explanation.
In Java, what does == compare when used on two object references?
The objects' sizes
The objects' class names
Whether the objects have equal contents
Whether both references point to the same object
Sign up free to see the answer and a step-by-step explanation.
What is an anonymous object?
An object with no class
An object that has been deleted
An object created without being stored in a named variable, usually used once
An object that is private
Sign up free to see the answer and a step-by-step explanation.
In Java, where are objects created with new stored?
In the CPU registers
In the source file
On the stack
On the heap
Sign up free to see the answer and a step-by-step explanation.
What is a method's signature?
Its name together with its parameter list
The comment above it
Its author's name
Its return value only
Sign up free to see the answer and a step-by-step explanation.
What is an immutable object?
An object whose state cannot change after it is created
An object with no methods
An object that cannot be deleted
An object that is shared by all classes
Sign up free to see the answer and a step-by-step explanation.