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

#2: Classes are created to define objects such that objects are instantiated fro

ID: 3687816 • Letter: #

Question

#2: Classes are created to define objects such that objects are instantiated from the class definition. Does it make any sense to create a class from which no object can be instantiated? If so, what would this special class be called in Java?

Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

#4: Describe polymorphic behavior in programming as compared to polymorphic behavior in science or nature.

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

#6 The following code snippet (code-6_1.txt) from the class student has two methods with the same name: reset. Is this an example of overriding, overloading, or an error?  code-6_1.txt

Explanation / Answer

2.
A class which contains the abstract keyword in its declaration is known as abstract class.
But, if a class have at least one abstract method, then the class must be declared abstract.
If a class is declared abstract it cannot be instantiated.
To use an abstract class you have to inherit it from another class, provide implementations to the abstract methods in it.
If you inherit an abstract class you have to provide implementations to all the abstract methods in it.

4.
Polymorphism is the ability of an object to take on many forms. The most common use of polymorphism in OOP occurs when a parent class reference is used to refer to a child class object.
It is important to know that the only possible way to access an object is through a reference variable. A reference variable can be of only one type. Once declared, the type of a reference variable cannot be changed.


6.
it is function overloading :
if both function has different type/number of arguments , that is called function overloading.