0% found this document useful (0 votes)
19 views22 pages

Computer 101

The document discusses various programming concepts, particularly focusing on object-oriented programming (OOP) principles such as encapsulation, inheritance, polymorphism, and abstraction. It includes definitions, examples, and comparisons of different programming languages and data types. Additionally, it covers topics like type conversion, method overloading, and the significance of constructors in OOP.

Uploaded by

hardipmallanwala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
19 views22 pages

Computer 101

The document discusses various programming concepts, particularly focusing on object-oriented programming (OOP) principles such as encapsulation, inheritance, polymorphism, and abstraction. It includes definitions, examples, and comparisons of different programming languages and data types. Additionally, it covers topics like type conversion, method overloading, and the significance of constructors in OOP.

Uploaded by

hardipmallanwala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 22
on UN More ton catenin ot pumsamiing se it a te cai of pga men a ‘cape lopalaa arama Q2 Mame two procedure oriented and two object oriented ProEraenent, Langan ry D) Two procedure oriented languages ace “OKTRAN and BAS G0 Tor tape ered tgp te Jove sod Pyro PRD st te tee mip it ner “4 pram t Dees Anawectom oa i St ation 44 principle that allows function t0 tbe used for multiple SF through the process of inheritance inherits properties from a base cass Satie a derives! cass O6 What docs rewability mean? rr pens used to perform 2 task sn base ca fs St Sia for other bype of proces eas feature & known as nrwsablity 107 State the Java concept that is imptemente* thevaph eo A cuperciass an a subclass ae of ecpreceting eset features of case withont soctding the background ICSE 2013), ICSE 20161 ag = toe used as 4 unit * Peres ode so that they jenmnd 2 Encapsaiation cst 2071 09 What is Inberitance? Jed reusability Jnteertance is an OOF _ « ‘ 10 What It ts an act of ple according ICSE 2018), aa vg, background anty aware of is imnportant part (it ont eclerawor. BY applying, brake mal enaxarsin of the driving # cat, you ar “8 forch, beak, S2P oe ced not POE For example. while CRrentiat features) viz. ct SSraop the car and tins vo rake of car a wD rag mee {244 ze ES © The proces by which» die 1) potymenphien 0) int Sama Wn tne ‘aioe & The proces (4) ercapmastaticn a 1% Which of the Soliowinng i Net Uses same feanetia @) Uses same op Rin mot a ae Doqec 2 Obes can comemamacate with cach other theosgh - po ontemted programemny, Langs. Po, date mt for litnn sme ead premmones the reumabiity teste, in cbyect remand peor ame Ss cage pee Ta Bail aT ait BOL aN male Swe can sy that they are interrelated What i the importance of the keywore new’ while creating am object? In this way real world objects and software objects are int Why is a clase called Glass is the protot type Hence, a clas § NICSE 20134 Wiite a Java statement to create an object mp of class digital Java statement to create an object mpt «class digital digital mp$ = new digital ) on Ane o2 Ane. 3 Ane os Ans os Ans Ans. What is meant by boolean variable? Boolean variable t 4 variable that Folds healewn What is the difference between “t-e" and true? true” (enciosed under double quotes) sa string Wieral wheress trae (without double quotes) fa boolean eral State the excape sequences for hocwontal tab and new line feed. fal ta“ and for new fine feed ~ ‘value, Le. trae or fale Escape sexquences for hon Is String type a primitive or non-primitive data type? String ie a specific data tvpe that 1 framed using various character data types: either 2 primitive nor a non primitive data type In what way float initialisation is different from double type initialisation? Ih heat type varie is initialised with a fractional value 2s O.0E whereas. 2 osbts N00. The difference Between: intialisations For example douiblle d-000D; What is a variable? Meese as a mamed memory locaina that i wed to contain a value that can RANE Senattling on the circumctinces during the execution of 2 program. Differentiate between pure and impure type expressions A pure expr tas the ‘dre came data type whereas, an impure eetsion contains elements of diferent data types What is meant by type conversion How is cexplist conversion? on. the result needs to be obtained in a single speciic data In @ mixed mode exp type: Hence, the data type 18 Known as type conversion. In an implicit ype conversion, the result of a mixed mode expression i obtsined the higher most data type of the For example, int a; float b; float c c=a+b: In case of explicit type conversion, the choice and requirement For example, int a; oat b; dow b= oatya * 0: averted to a required type. This process of conversion ec Give one example cach of a primitive data type and 2 composite data type. type: im. Bloat, double, long, chat, etc. (amy one) Examples of prim: ay, class, interface, etc (amy one) Examples of composi State the values of n and ch. char coh int n=c#l char che(chann . ACs 200 The value of n= mu wesaosd ¢ ast ad 020 Match the following, literals of Column A with the variables of Column Cotame A <7 eee Pee + bos cane has it Seng ass a .« oo 002s ee am oo on on ou Oe AED. L. Multiple Choice Questions: 1 lata type occupies in the memory? os « om primitive data type? ow wr 2 Which of the following GB String 3. Which of the following, {or Boolean " 2) double Which of the following ade range is applicable for lowercase letters? “5-0 %) AF 122 5-00 ow al atements are ‘True’ or ‘False’ whether the followi of diferent chav acters used in a Java program. ic L Fe € There are 128 se The ASCII codes of uppercase letters range fom 97 40 122. ‘A variable gives the exact repr station of data. The data types int, lot, char are called non primitive types. A Steing literal is assigned to a ‘ring, variable 2 3 “ (A character literal is always enclowed in double quotes 7 String constant can be written by using a set of alphanumeric tharacters An object is said to be a non-primitive data > 9. The data type int stores fractional values. é 10. Boolean type data is used to test a condition and results in cither true or false : 1. Multiple Choi : m1, 7. Which of the following isthe corect precedence of logical operators? ooh ) he Mt (OIL wee (a) ate IL! 2 Choose the odd one out from the following: o> ® oe a wa me String, st = (a>= 90)? “Excellent”: “Best”, Predict the output, when a = 90. aa jae Becca, D sex ee es oe —_—— Oe a eres = eis pa Ba Ee FE a a tee 4. Giver: int m=5; m°=5 then the value stored in m ** F 2 Se 2 ee c Ee lier ntastym | Oo tage Dene Made-ChaH OtbtC°d) ps « es <2? a Btcee afer ciao =e 2019-2 23S ay +P-i ore ae on Se = (val « 550 < IOP 20 a, Wf @) val ~ 1099 (@) Arithunetic operation ®) Relational operair « @) Unary de Binary arithmetic og--rator ©) Posttix increment and Pretix tncormaene (©) Posttix decrement @ (= y and Kp == What is the difference between d % operator What will be the outy k 0) Hint ¥ =10 then find int 2 = (oeyripes + sy (0) Give the output of the followig expocmtan See Ont + 240+ +o: wena h @) What is the value of y ater the: execution? Yen +9y + 9 + 9: when int pute serie the following program seyment wing i-cse atcements inated of the ternary operator OF cnt Fade = (marks >= S057 A”: (mar om Bayo “ar cs ©) commision = (sale > S000) ? (sake"10)/100 (©) net = (salary > 10000) ? salary @ 8= (asd < cf asc < emu > = thee wis #premept mg yeu forthe ita name Yu can vse whatewer you want ere os can ues any vali i ter cate aps ane cant sar with * umber ly fst hor hs has been compre ae un {muy hepeemtaien cor ‘artame of ewer "You cm ght ich thi meted of Ho) Pebpmorphien nates byes of different cases tobe treated an cect of ass (common) Ais a special methoa! that fs automatically called when an object is created from 3 class. The process of hiding the internal details of an otyet and showing, only the necessary features alle {abstraction} Introduction to Object-Oriented Programming Concepts ‘What is encapsulation in OOP? a a SO single unit called an fet. It hides the internal details ofan obyet ‘What is polymorphism in OOF? Petpet alow co cen Seth waned che of COMB ESPORTS enables method overiaading and method overrileg, What is 2 comstractor in OOF? ‘A comotractar sa special method ina class that is automatically called when 28 jects created. tis used to initialize object propertics ‘What is the purpone of the this’ keyword in OOF? Me he bey bord vier to the caren instanceof a lam. tis often used to dating PESSSSISS SE variables and method parameters with the same name Explain method ovesoading in OOP, Method overioading isa feature that allows a claw” to have multiple ae eer Rees The mtd cali deter ned by the number or 17Pea of SIBURENS nethods with the same name bul What is an abstract clas in OOP ‘Am abstract clas is a class that cannat be instantiated fue abseract snethods that aaust be implemented What is the importance of OOP in software develo OOP promotes code reusability, moxtulanty, and pplic Gera he perpone ofa conctractx in OOP, and how do you crest ont i FY A axnstracto ntiatne the attribaes of an object when it created. in Python. $3 GIs 3 son method within a clas. For example “fect, parameterl, parameter2) = Saat-ateribates ~ paraseter? self _attribute? - parancte: How does inheritence work in OOP? Provide an example of 3 Dae Jass and a derived clas and methods from a base dass. For example opt a (at) acts a peat fron the “cs to Fabre ner using seers performs aciition, subtraction, maitipcsion a se sting 4 plineinome 0 vam between a specified fange andl asks St Tow nti the corect numbers guess Implement a Java application Proce hi ae ork ae a ents oe ee coe | coast | pore oe Se wid eee Ol —— See ee a. aoe The sarod an array mast apes OF a Woe the dain web fen choc serene ase FSS a saan re tha jin acaba mw } x woe 8 ea mae rte ote eosin Sa eager scakssoanner ‘ Meiamesacsexsnat! ara (syst 2a mh systan.ost print . y arse ( A Se ont price vers temperate from C vice iapot) reverse) toStetag ts system out.peintin (input: + 74s 2 palindromes for (amt 1 = 25 1 Lf (om BS me Oy retara falees ) weet

You might also like