59763132 5 importent point for oops

Upload: tbijle

Post on 27-Feb-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/25/2019 59763132 5 Importent Point for OOPs

    1/21

    Attendees View

    RaiseHand

    Option

    In case you are not able to hear the voicePlease click on the raise hand option. Wiziq Supportchat will help you for the same. Any issues you canping the Wiziq support chat user

  • 7/25/2019 59763132 5 Importent Point for OOPs

    2/21

    5 important OOP Interview questions

    We will have a extensive Q and A session , so reserve your questions after thecourse.

    5 Important OOP Interview Questions aturday, April !", #"!", at !"$"" A% &I '( 5 Important A P.)*' Interview Questions unday, April !!, #"!", at !"$"" A%&I '( 5 Important Q+ erver Interview Questions aturday, April ! , #"!", at !"$"" A%&I '( 5 Important .)*' Interview Questions unday, April !-, #"!", at !"$"" A% &I '( 5 Important A O.)*' Interview Questions aturday, April #/, #"!", at !"$"" A%

    &I '(

    www.QuestPond.com

    By Shivprasad Koirala

    http://www.questpond.com/http://www.questpond.com/
  • 7/25/2019 59763132 5 Importent Point for OOPs

    3/21

    Visit to view 300 videos @

    http://www.questpond.com

    http://www.questpond.com/http://www.questpond.com/
  • 7/25/2019 59763132 5 Importent Point for OOPs

    4/21

    he big Picturewww.Questpond.Com

    http://www.questpond.com/http://www.questpond.com/
  • 7/25/2019 59763132 5 Importent Point for OOPs

    5/21

    Agenda

    What are the ! important principles in ""P#

    What$s the difference between abstract class and interface#

    What are the different types of polymorphism#

    What is overloading and overriding#

    %ow do we achieve encapsulation in &'#

    www.QuestPond.com

    http://www.questpond.com/http://www.questpond.com/
  • 7/25/2019 59763132 5 Importent Point for OOPs

    6/21

    http://www.wiziq.com/online-class/2 2!"3-oop-inte#view-questions $ %end a messa&e to 'iziq %uppo#t chat use# o# (ou can call )o# mo#e details @ *- 2*+,0",0"$ , mpo#tant #inciples$ st#action1 ncapsulation1 nhe#itance and ol(mo#phism.

    $ nte#view questions cove#in& st#action1 ncapsulation1 nhe#itance and ol(mo#phism.$ oncepts o) st#act classes and nte#)aces$ nte#view questions a#ound a st#act classes and inte#)aces$ oncept o) ol(mo#phism and di))e#ent t(pes o) pol(mo#phism$ nte#view questions a#ound static and d(namic pol(mo#phism.$ oncept o) %hadowin&$ nte#view questions a#ound shadowin& and ove##idin&.$ oncept o) access modi)ie#s$ nte#view questions a#ound ccess modi)ie#s and encapsulation.$ oncept o) %tatic 4e(wo#d$ nte#view questions a#ound %tatic 4e(wo#d.$ 3 tie#-a#chitectu#e concepts usin& OO %$ nte#view questions 3-tie# a#chitectu#e.$ %tud( mate#ial with ou#se

    $ %ou#ce code o) what is ta4en in the class

    $ nte#view questions oo4 cove#in& ,00 nte#view question 56 with answe#s

    $ * month o) su sc#iption o) ,00 videos cove#in& ' 61' 61''61 zu#e1%ilve#li&ht 1 5esi&n patte#n 1 789 and lot mo#e. lic4 on the elow ima&e to 4now a out the same.

    www.QuestPond.com

    http://www.wiziq.com/online-class/292853-oop-interview-questionshttp://www.questpond.com/http://www.questpond.com/http://www.wiziq.com/online-class/292853-oop-interview-questions
  • 7/25/2019 59763132 5 Importent Point for OOPs

    7/21

    'hat a#e the , impo#tant p#inciples in OO www.QuestPond.com

  • 7/25/2019 59763132 5 Importent Point for OOPs

    8/21

    Whats a abstract class ?

    Abstract classes are one of the essential behaviors provided by .() . &ommonly* youwould like to make classes that only represent base classes* and don$t want anyone

    to create ob+ects of these class types. ,ou can make use of abstract classes toimplement such functionality in &' using the modifier -abstract-.

    An abstract class means that* no ob+ect of this class can be instantiated* but canmake derivations of this.

    An abstract class can contain either abstract methods or non abstract methods.Abstract members do not have any implementation in the abstract class* but thesame has to be provided in its derived class.

    An abstract class cannot be a sealed class. I.e. the following declaration is incorrect.

    www.QuestPond.com

  • 7/25/2019 59763132 5 Importent Point for OOPs

    9/21

    www.QuestPond.com

  • 7/25/2019 59763132 5 Importent Point for OOPs

    10/21

    'hat;s a inte#)ace

  • 7/25/2019 59763132 5 Importent Point for OOPs

    11/21

  • 7/25/2019 59763132 5 Importent Point for OOPs

    12/21

    'hat;s a di))e#ence etween inte#)aces and a st#act classes

  • 7/25/2019 59763132 5 Importent Point for OOPs

    13/21

  • 7/25/2019 59763132 5 Importent Point for OOPs

    14/21

    oth the method namesare same but they actdifferently as per inputs

    his will invoke thecalculation of total costwith out discount.

    his will invoke the

    calculation of total costwith discount.

    Static polymorphism is achieved by usin method ov

  • 7/25/2019 59763132 5 Importent Point for OOPs

    15/21

    Parent Product class

    Inherited Child Product class

    !irtual "eyword necessary to override the method

    Override "eyword necessary to de#ine new implementation

    Class inherited and getTotalCost overriddenwith new functionality

  • 7/25/2019 59763132 5 Importent Point for OOPs

    16/21

    clsProduct objProduct;

    objProduct new clsProduct!";objProduct#getTotalCost!int$ty% intPerProductCost%&'()&"

    objProduct new clsProductWith*iscount!";

    objProduct#getTotalCost!int$ty% intPerProductCost%&'()&"

    $his invo"es the parent class code

    $his invo"es the child class code

    %ynamic polymorphism is achieved by usin overridin

    www.QuestPond.com

  • 7/25/2019 59763132 5 Importent Point for OOPs

    17/21

    'hat is ove#loadin& and ove##idin&

    www.QuestPond.com

  • 7/25/2019 59763132 5 Importent Point for OOPs

    18/21

    cls #oduct o = > new cls #oduct? A

    o =. hec4 #oduct?int e# #oduct ost A

    o =. hec4Bt(?intBt( A

    int total ost > o =.&et new cls #oduct? A

    o =. e# #oduct ost > int e# #oduct ostA

    o =.Buantit( > intBt(A

    )ncapsulation means hiding comple/ity)/trae/posedfunctionalities.

    &omp

    licationencapsulate

    www.QuestPond.com

  • 7/25/2019 59763132 5 Importent Point for OOPs

    19/21

  • 7/25/2019 59763132 5 Importent Point for OOPs

    20/21

    http://www.wiziq.com/online-class/2 2!"3-oop-inte#view-questions$ %end a messa&e to 'iziq %uppo#t chat use# o# (ou can call )o# mo#e details @ *- 2*+,0",0"$ , mpo#tant #inciples$ st#action1 ncapsulation1 nhe#itance and ol(mo#phism.

    $ nte#view questions cove#in& st#action1 ncapsulation1 nhe#itance and ol(mo#phism.$ oncepts o) st#act classes and nte#)aces$ nte#view questions a#ound a st#act classes and inte#)aces$ oncept o) ol(mo#phism and di))e#ent t(pes o) pol(mo#phism$ nte#view questions a#ound static and d(namic pol(mo#phism.$ oncept o) %hadowin&$ nte#view questions a#ound shadowin& and ove##idin&.$ oncept o) access modi)ie#s$ nte#view questions a#ound ccess modi)ie#s and encapsulation.$ oncept o) %tatic 4e(wo#d$ nte#view questions a#ound %tatic 4e(wo#d.$ 3 tie#-a#chitectu#e concepts usin& OO %$ nte#view questions 3-tie# a#chitectu#e.$ %tud( mate#ial with ou#se

    $ %ou#ce code o) what is ta4en in the class

    $ nte#view questions oo4 cove#in& ,00 nte#view question 56 with answe#s

    $ * month o) su sc#iption o) ,00 videos cove#in& ' 61' 61''61 zu#e1%ilve#li&ht 1 5esi&n patte#n 1 789 and lot mo#e. lic4 onthe elow ima&e to 4now a out the same.

    www.QuestPond.com

  • 7/25/2019 59763132 5 Importent Point for OOPs

    21/21

    Visit to view 300 videos @

    http://www.questpond.com