Introduction To Object Oriented Programming - Assignment 2
The document is an assignment for an Introduction to Object-Oriented Programming course at Cambridge School. It consists of two sections: Section A includes theoretical questions about concepts like inheritance, polymorphism, method overloading, method overriding, and the differences between interfaces and abstract classes. Section B requires students to write programs that print a greeting and display user input for name, age, and email in a specified format.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
6 views1 page
Introduction To Object Oriented Programming - Assignment 2
The document is an assignment for an Introduction to Object-Oriented Programming course at Cambridge School. It consists of two sections: Section A includes theoretical questions about concepts like inheritance, polymorphism, method overloading, method overriding, and the differences between interfaces and abstract classes. Section B requires students to write programs that print a greeting and display user input for name, age, and email in a specified format.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1
Cambridge School
Introduction to Object-Oriented Programming
Assignment - 2
Section - A
Answer the following:
1. How does inheritance help in code reusability?
2. What is polymorphism? Give an example.
3. What is the difference between method overloading and method overriding?
4. What is an abstraction in OOP?
5. How is an interface different from an abstract class in Java?
Section - B
Answer the following:
1. Write a program to print your name.
Example: Input: Enter your name: Arthi Output: Hello Arthi! Welcome to Cambridge School! 2. Write a program to take input of name, age, email id and print in the given format. Example: Input: Enter your Name: Aarav Enter your Age: 14 Enter your Email Id: [email protected] Output: Student Name: Aarav Age: 14 Email Id: [email protected]