Question
OO Program question. 1.What are the policies of Java and C++ surrounding covariance, contravariance and nonvariance? 2.Define inheritence by generalization. What is abetter OO solution
OO Program question.
1.What are the policies of Java and C++ surrounding covariance, contravariance and nonvariance?
2.Define inheritence by generalization. What is abetter OO solution to a situation using this form of inheritance?
3.Describe two situations when using separate compilation in C++ which require you to #include a header file.
4.What is the role of the Class Object in ruby? Suppose you define a class called MyClass. What is the type of the Class Object in ruby for MyClass?
5.Ruby is a dynamic object-oriented programming language. Name and briefly describe two features of ruby that are
more dynamic than C++ or Java. Use any technical terms that are appropriate.
6.Suppose you have the following interface and class definitions in Java:
interface A { void job1 (String x); }
interface B { void job1 (String x, String y); }
interface C { void job2 (String x); }
public class D implements A,B,C { ... }
List the methods (if any) that the class D is required to have given the declaration above. Give the
methods by their full signature (i.e., the method header); you are not required to give a body for any of the
methods. If D requires no methods, say so.
7.What are the roles of packages in Java? Why would we put two classes in the same package (ordifferent packages)?
What is the significance of public classes in a package.
Thanks!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started