oops with java-2015

Upload: brahmesh-mandya

Post on 21-Feb-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/24/2019 OOPS With Java-2015

    1/2

    Object Oriented Programming with Java

    I Internals

    Date: 22-09-15 Duration: 75 Min Max Marks: 35 Staff: S M Bramesh

    Note: Answer anyfive full questions, each question carries sevenmars!

    " List out the differences et!een structures and c"asses#

    # $h% shou"d defau"t &a"ues are to e 'i&en to function ar'ument in the function (rotot%(e) *x("ain !ith an exam("e#

    $ Define the +this, (ointer !ith an exam("e indicate the ste(s in&o"&ed in referrin' to memers of the in&okin' o.ect#

    % $rite a / (ro'ram to create a c"ass ca""ed /ML* and im("ement the fo""o!in' o&er"oadin' functions 4DDthat return a /ML* numer#

    i# 4DDa s26 - !here +a, is an inte'er rea" (art6 and +s2, is a com("ex numer#

    ii# 4DDs1 s26 - !here +s1, and +s2, are com("ex numers#

    & $rite a /(ro'ram to count the numer of o.ects of a certain c"ass#

    ' Demonstrate !ith / (ro'ram for i6 assin' o.ects to functions ii6eturnin' o.ects from functions

    ( *x("ain ho! +ne!, and +de"ete, o(erators mana'e the memor% a""ocation 8 dea""ocation d%namica""% !ith an

    exam("e#

    ) $hat is the enefit of co(% constructor) *x("ain the necessit% of definin' %our o!n co(% constructor)

    Object Oriented Programming with Java

    I Internals

    Date: 22-09-15 Duration: 75 Min Max Marks: 35 Staff: S M Bramesh

    Note: Answer anyfive full questions, each question carries sevenmars!

    " List out the differences et!een structures and c"asses#

    # $h% shou"d defau"t &a"ues are to e 'i&en to function ar'ument in the function (rotot%(e) *x("ain !ith an exam("e#

    $ Define the +this, (ointer !ith an exam("e indicate the ste(s in&o"&ed in referrin' to memers of the in&okin' o.ect#

    % $rite a / (ro'ram to create a c"ass ca""ed /ML* and im("ement the fo""o!in' o&er"oadin' functions 4DD

    that return a /ML* numer#

    i# 4DDa s26 - !here +a, is an inte'er rea" (art6 and +s2, is a com("ex numer#

    ii# 4DDs1 s26 - !here +s1, and +s2, are com("ex numers#

    & $rite a /(ro'ram to count the numer of o.ects of a certain c"ass#

    ' Demonstrate !ith / (ro'ram for i6 assin' o.ects to functions ii6eturnin' o.ects from functions

    ( *x("ain ho! +ne!, and +de"ete, o(erators mana'e the memor% a""ocation 8 dea""ocation d%namica""% !ith an

    exam("e#

    ) $hat is the enefit of co(% constructor) *x("ain the necessit% of definin' %our o!n co(% constructor)

    Object Oriented Programming with Java

    I Internals

    Date: 22-09-15 Duration: 75 Min Max Marks: 35 Staff: S M BrameshNote: Answer anyfive full questions, each question carries sevenmars!

    " List out the differences et!een structures and c"asses#

    # $h% shou"d defau"t &a"ues are to e 'i&en to function ar'ument in the function (rotot%(e) *x("ain !ith an exam("e#

    $ Define the +this, (ointer !ith an exam("e indicate the ste(s in&o"&ed in referrin' to memers of the in&okin' o.ect#

    % $rite a / (ro'ram to create a c"ass ca""ed /ML* and im("ement the fo""o!in' o&er"oadin' functions 4DD

    that return a /ML* numer#

    i# 4DDa s26 - !here +a, is an inte'er rea" (art6 and +s2, is a com("ex numer#

    ii# 4DDs1 s26 - !here +s1, and +s2, are com("ex numers#

    & $rite a /(ro'ram to count the numer of o.ects of a certain c"ass#

    ' Demonstrate !ith / (ro'ram for i6 assin' o.ects to functions ii6eturnin' o.ects from functions

    ( *x("ain ho! +ne!, and +de"ete, o(erators mana'e the memor% a""ocation 8 dea""ocation d%namica""% !ith an

    exam("e#

    ) $hat is the enefit of co(% constructor) *x("ain the necessit% of definin' %our o!n co(% constructor)

  • 7/24/2019 OOPS With Java-2015

    2/2

    Object Oriented Programming with Java

    I Internals*+I-

    Date: 22-09-15 Duration: 15 Min Max Marks: 5 Staff: S M Bramesh

    Note: Answer all full questions, each question carries 2mars!

    "!$rite a (ro'ram that encoura'es the user to enter t!o fractions and the dis("a% their sum in fractiona" form#

    he interaction !ith the user mi'ht "ook "ike this:

    *nter first fraction: 1 8 2

    *nter second fraction: 2 8 5

    Sum 9 8 10

    #! $rite a (ro'ram that !i"" ca"cu"ate the fo""o!in'

    Object Oriented Programming with Java

    I Internals*+I-

    Date: 22-09-15 Duration: 15 Min Max Marks: 5 Staff: S M Bramesh

    Note: Answer all full questions, each question carries 2mars!

    "!$rite a (ro'ram that encoura'es the user to enter t!o fractions and the dis("a% their sum in fractiona" form#

    he interaction !ith the user mi'ht "ook "ike this:

    *nter first fraction: 1 8 2

    *nter second fraction: 2 8 5

    Sum 9 8 10

    #! $rite a (ro'ram that !i"" ca"cu"ate the fo""o!in'

    Object Oriented Programming with JavaI Internals*+I-

    Date: 22-09-15 Duration: 15 Min Max Marks: 5 Staff: S M Bramesh

    Note: Answer all full questions, each question carries 2mars!

    "!$rite a (ro'ram that encoura'es the user to enter t!o fractions and the dis("a% their sum in fractiona" form#

    he interaction !ith the user mi'ht "ook "ike this:

    *nter first fraction: 1 8 2

    *nter second fraction: 2 8 5

    Sum 9 8 10

    #! $rite a (ro'ram that !i"" ca"cu"ate the fo""o!in'