• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/21

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

21 Cards in this Set

  • Front
  • Back

What is OOP?

Programming language model organized around objects rather than "actions" and data rather than logic.

Basic concepts of OOP?

-Encapsulation


-Inheritance


-Polymorphism


-Abstraction

What is a class?

A class is simply a representation of a type of object. It is the blueprint that describes the details of an object

What is a object?

An instance of a class. It has its own state, behaviour and identity

What is Encapsulation?

Encapsulation is a mechanism of wrapping the data and methods together as a single unit.




Hides the properties and methods which protect the code from accidental corruption.

What is Abstraction?

Process of hiding the implementation details from the user, only the functionality will be provided to the user.

What is polymorphism?

Polymorphism is the programming language's ability to process objects differently depending on their data type or class. More specifically, it is the ability to redefine methods for derived classes.

What is inheritance?

Inheritance is a concept where one class shares the structure and behavior defined in another class.

Define a constructor?

A method used to initialize the state of an object, and it gets invoked at the time of object creation.




-Constructor name should be same as class name


-Constructor must have no return type

What is an in-line function?

Technique used by the compilers and instructs to insert complete body of function wherever that function is used in the program source code.

What is a friend function?

Friend function is a friend of a class that is allowed to access public, private or protected data in that same class. If the function is defined outside the class, the class cannot access such information.

What is function overloading?

Same as a normal function but the ability to perform different tasks. Allows creation of several methods with the same name which differ from each other by type of input and output of the function.

What is operator overloading?

A function where different operators are applied and depends on the arguments.

What is a abstract class?

A class which can't be instantiated. Only for inheritance. Can only contain abstract methods.

What is a ternary operator?

Operator which takes three arguments.

What is a singleton pattern?

Singleton pattern is a design pattern that restricts the instantiation of a class to one object.

When is it used?

This is useful when exactly one object is needed to coordinate actions across the system

What is a factory method?

A interface for creating an instance of a class, with its subclasses deciding which class to instantiate

Difference between overloading and overriding?

Overloading is static binding (compile time) whereas overriding is dynamic binding (runtime).




Overloading is nothing but the same method with different arguments, and it may or may not return the same value in the same class itself




Overriding is the same method names with same arguments and return types associates with the class and its child class

Prime numbers algorithm

if n <= 1
return false


if n >= 3


return true


i = 1


While i*i <= n


if n%i == 0


return false


i += 1


return true

What is an interface?

An interface is a programming structure/syntax that allows the computer to enforce certain properties on an object (class