You are on page 1of 5

COMPUTERSCI ENCEVI VAQUESTI ONS- 2022

1.Whatisobj ectandcl assi nOOP?


Obj ectisani nst anceofacl ass.Classi scoll
ectionofsimilarobject
s.
Acl assbi ndsdat amember sandmemberf uncti
onst oget
her .
2.Whatar edat amember sandmemberf unctions?
Datamember sar et hevar iablest hatstor esomeval ueandrepr esentsomechar act
eri
sti
c
oft
heobj ect
Memberf unct ioni sabl ockofst atement sbel ongst oaclassthatcanper f
orm some
operat
ionondat amember s.
3.Li
sttheaccessspeci fiersusedwi thacl ass.Namet hedefaultaccessspecifi
er.
 Pr i
vat e
 Publ ic
 Pr otected
Thedef aultaccessspeci f
ierispr i
vate
[ Accessspeci f
iersdef i
net hescopeoft he
dat a]
4. Whichoper at orisusedt oaccesst hemember sofacl ass?
Dot[ .]Oper atori susedt oaccesst hemember sofa
clas s
.
5.Whatist hesi gnifi
canceofscoper esolut i
onoper ator?
 Scoper esol uti
onoper ator(::
)isusedt odef i
nethememberf uncti
on
out sidet hecl ass .
.
6.Whatisl i
neardat ast ructure?Gi veanexampl e.
Thedat ast ruct ureinwhi chel ement sar eor ganizedi nli
nearf
or m,(oneaft
erother)
Eg:Arr
ays,s tack,Queue,Li nkedLi st

7.Whati
sanar r
ay?Menti
onthedisadvant
agesofanar
ray.
Anarr
ayisacoll
ect
ionofel
ementsofsamedatat
yperef
err
edbyasi
ngl
ename.
Di
sadvant
age:

 Ar rayi sstatics t
ructure.
 Wemustknowi nadvancet hathowmanyel ementsaretobest or
edinar
ray.
 Si ncear rayi soff i
xedsi ze,ifweal l
ocatemor ememor ythanrequi
rement
thent hememor yspacewi l
lbewast ed.
8.Definesear ching.Nameanyonemet hodf orsearching.
Iti
sthepr ocessofl ocat i
ngt heposi t
ionofsomeel ementinthearray.
Li
nearsear chmet hod,Bi narysear chmet hod
9.Definesor t
ing.Nameanyonemet hodofsor t
ing.
Thepr ocessofar rangingel ement seitherinascendi ngordescendingorderi
s
cal
leds orti
ng.
Bubbles ortorIns erti
ons or
torQui cks ort
,Mer ges ort
,sel
ect
ions or
t,heapsor
t
10.
Whati sinserti
onanddel eti
onoper ati
ononar rays?
Addinganewel ementi ntothear rayiscalledinsertion
Removinganel ementf rom t hear r
ayi scall
eddel etion

11.Whatismeantbyfuncti
onover
loadi
ng?
Funct
ionover
loadi
ngisaconceptwher
eapr
ogr
am canhavet
woormor
efunct
ions
1
witht
hesamename,wi t
hdiff
erentnumberofargument
sanddat
atypeof
argument
s.(signatur
eofthefuncti
on)
.
Functi
onover
loadingisanexampleofpolymorphi
sm.

12.
Def
ineinl
inefunct
ion.Menti
ononeadvant
age.
I
tisaspecialmemberfunct
ionwhosef
unct
ioncal
li
srepl
acedbyf
unct
ionbody.
Advantages

● I
nli
nefunct i
onincr
easest hespeedofex ecut
ion*
● Thereadabili
tyoft
hepr ogr am i
ncreas
es*
● Veryeffi
cientcodecanbegener ated.
● Theinl
inememberf uncti
onsar ecompactfuncti
oncal
l
s,t
her
ebyt
hesi
ze
oft
heobj ectcodeiscons iderabl
yreduced.

13.Whati sconst r
uct or?Ment i
ont ypes.
Aconst r
uct orisaspeci al memberf unct
ionthati saut omat i
cal
lyinvokedwhenan
objectiscr eatedandi susedt oini
ti
ali
zetheobj ectsofacl assautomat i
call
y.
Ithassamenameast hatoft heclass.
Ther earet hreet ypesofconst ruct
ors,namely:
1. De faultcons t
ructor
2. Pa ramet erizedcons tructor
3. Copyc ons tructor
14.Whati scopyconst r
uctor ?
Copyconst ructori sapar amet erizedconstr
uctorusi ngwhi choneobj ectcanbe
copiedt oanot herobj ect.
15.Givedi ffer
encebet weendef aultandpar ameterizedconst r
uct or.
Def aultconst r
uct or Paramet erizedconst ructor
Aconst r
uct orwhi chdoesn’ taccept Aconst ructorwhi chaccept s
anyar gument si scalledadef ault argument si scalledapar amet eri
zed
const r
uctor . const ructor.
Itcannotbeover loaded Itcanbeover loaded.
Allobjectsar ei ni
tial
izedt osamesetofDi ff
er entobj ectscanbei nit
ial
i
zedt o
values. diff
erentval ues.
16.
Whati
sinher
it
ance?Ment
ionanyonet
ypeofi
nher
it
ance.
I
tist
hepr
ocessofder
ivi
nganewcl
assf
rom t
heexi
sti
ngcl
ass.
OrI
tisacqui
ri
ngt
hepr
oper
ti
esofonecl
asst
oanot
hercl
ass.
Typesofi
nher
it
ance
Si
ngl
elevel
inher
it
ance
Mul
ti
l
evel
Mul
ti
ple
Hi
erar
chi
cal
Hybr
id
17.
Whatisapointer
?Ment i
onadvantages.
Point
erisavari
ablewhi chst
orestheaddressofanot
hervar
iabl
e.
Advantages:
 Pr operuti
l
izati
onofmemor y
 Dynami callocati
onanddeal l
ocat
ionofmemor y
2
 Easytodealwi
thhardwarecomponents
 Iti
spossi
blet
owrit
eeffi
cientpr
ograms.
 Establ
i
shescommunicati
onbetweenpr ogr
am anddat
a
18.
Whati
stheuseof*and&oper atorswit
hrespecttopoi
nter
s.
*i
spoi
nteroper
ator
.i
tuset
odecl
areapoi
nterand i
tret
urnst
heval
ueoft
hevar
iabl
e,
&i saddressoperat
or.I
tret
urnsmemor yaddressofvar
iabl
e.
19.
WhatisSQL?Ment iononeSQLpackage.
SQLst
andsf orStr
uct
uredQuer yLanguage.Languageusedtocommuni
cat
ewi
thRDBMS.
Or
acl
e,Sybase,Mi
crosof
tSQLSer
ver
,Acces
s
20. Whati
sprimar
ykey?
Anat
tr
ibut
eorSetofat
tr
ibut
eswhi
chuni
quel
yident
if
yeachr
ecor
dinat
abl
e.

21.
Ment
ionDDLcommandsusedi
nSQL.
Creat
eAlterDropaloknownas[
s CAD]
22. Dif
fer
enti
ateDROPandDELETEcommandsi nSQL
DELETE DROP
DELETEisusedt or
emovet upl
esor DROPi susedt
oremoveent i
ret
abl
e
rowsfr
om atable.
I
tisaDataManipulat
ionLanguage I
tisaDat
aDefi
nit
ionLanguage(
DDL)
(DML)command Command

23. Mentiont hedatatypesusedi nSQL.


 I nt(number )
 Fl oat
 Dat e
 Char
 Var char
24.
Givethecommandt odisplayallr
ecordsordet
ail
sint
hetabl
e.To
displ
ayallrecor ds
Sel
ect*Fr om tabl
ename;
Todisplayselectedr ecords
Sel
ect*Fr om tabl
e_name[ Wherecondi
ti
on;
]
25. Whati stheuseofHTML?Li stthebasi
ctagandformat
ti
ngtagsofHTML.
HTMLi susedt ocreat
ewebpages.
BASICTAGS

<ht
ml> Def
inesanHTMLdocument

<head> Def
inesi
nfor
mat
ionaboutt
hedocument

<body> Def
inest
hedocument
’sbody

<h1
>to<h6> Def
inesHTMLheadi
ngs

<br
> I
nser
tasi
ngl
eli
nebr
eak

3
<f
ont
> The<font>tagisusedt ochanget heformatof
thet
extont hewebpage
<b> The<b>t agwillboldthetextinsidethetag.
<i
> The<i>tagwi l
li
tali
cizethetextinsi
det hetag.
<u> The<u>t agwillunderli
nethet exti
nsidethetag.

HeaderTags Theheadert ags<h1 >,..


.<h6>all
owsust o
placeadditionalimportanceonthetextwit
hin
suchtags.
<h1 >hasthel argestsi
ze,and<h6>t hesmall
est
<cent
er> The<cent er>t agcausesallthet
extwithi
nthe
tagtobecent ered
<p> The<p>t agi ndicatesanewpar agraph
<sub> Subscripttext
<sup> Superscripttex t

*
***
***
***
***
***
** ALLTHEBESTFOREXAMS *
***
***
***
***
***
***
*

4
5

You might also like