Home
Sign in
Close menu
Home
Sign in
Lesson list
Introduction to Ruby and Object Oriented Programming
Close
Chapter 1: Getting Started with Web Development
1. Goals of the Intro Course
2. Guidelines for Learning
Chapter 2: Ruby Fundamentals
1. Introduction to Ruby
2. Setting up your environment
3. Super basic command line crash course
4. Your First Ruby Program
5. Math is easy
6. Strings
7. Variables
8. Arrays
9. Hashes
10. Looping and Iterating
11. Defining our own methods
12. Conditionals and Logical Operators
Chapter 3: Object oriented programming
1. Introduction to Object Oriented Programming
2. Classes
3. Instance Variables
4. attr_reader and attr_writer
5. Instance Methods, Class Methods, and Encapsulation
6. Inheritance
Chapter 4: Ruby challenges
1. FooBar Challenge
2. Test-First Ruby: Hello
3. Challenge: Temperature Conversion
4. Challenge: Ordinal
5. Challenge: Building a Deck of Cards
Introduction to Ruby and Object Oriented Programming > Object oriented programming
Quiz - 5. Instance Methods, Class Methods, and Encapsulation
Q1.
Instance Methods
allows single instance variable declaration.
can be called only through the object of the class.
can access instance variables.
works outside the instance of the class.
Q2.
Class variables
and instance variables are same.
are defined with @@ prefix.
are used by class objects as well.
are specific to instance of the class.
Q3.
Class methods
are declared with 'self.' prefix.
work only for the class.
are used by class objects.
do not require object initialization.
Q4.
Encapsulation
can be attained with the use of private keyword.
allows access of the method from other classes directly.
allow developers to hide the implementation of methods.
Submit