0% found this document useful (0 votes)
8 views4 pages

Chapter 2

This are the notes of chapter 2 of class 10th icse

Uploaded by

sureshyadav4612
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)
8 views4 pages

Chapter 2

This are the notes of chapter 2 of class 10th icse

Uploaded by

sureshyadav4612
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/ 4
—= Questions * Define insta OL setts Ince variable, Give an example (ICSE 2007) 2. Menti ; ON any two attributes required for class declaration. : (ICSE 2008) 3. Explain instance variable, Give an example. (ICSE 2008) 4. @ What is the use Of the keyword this? (ii) Why is class Called a factory of objects? (ICSE 2009) 5. Consider the following code and answer the questions that follow ; (ICSE 2009) Class academic { Static int XY} Void access() { int a,b; academic student=new academic( ); System.out.printin(“Object Created”); } } (i) What is the object name of class academic? (ii) Name the class variable used in a program. (iil) Write the local variable used in the program, (iv) Give the type of function used and its name. 6. (i) Differentiate between static and non-static data members. on P ject called an instance of a Class? (ii) Why is an ob (ICCE on: pT cose a? nthe of the t ; method argument or argument variable i) ii) 18 ii toe civ) instance class myclass program given below, state the name and the value ss variable al variable variable (ICSE 2012) { F static int X74 ty? ; mule static void main(String args{]) «tess objenew myClass( ); gyster.out.printin(); op.sampleMethod( 5); int a=0% gystem.out.printin(a); } void sampleMethod(int n) { gystem.out.printin(n); gystem.out.printin(y); } } 8, () What is the difference between an object and a class? (ji) Which unit of the class gets called when the object of the class in created. (iii) Name the keyword that (a) informs that an error has occured in an input and output operation. (b) distinguishes between instance variables and class variables. (ICSE 2011) 9. Write a Java statement to create an object mp4 of class digital. (ICSE 2013) 10. Consider the following class : public class myClass { public static int x=3, y=4; Public int q=2, b=3; } (i) Name the variables for which each object of the class will have its own distinct copy. ii) Name the variables that are common to all objects of the class. (ICSE 2014) te 124 used to 11. Name the keyword which © ee between method param rand stan? ese it class? 12. Why is an object called an instance of a acse 201 2 a cla ys the vatite se 5019) 13. Name the keyword which make: methods variable. ie les ant 14. The blueprint that defines the variabl ae common to all of a certain Ki kind is is termed (a) class (p) object 2022) (©) package (@metiad CSE 15. class is us ype to its corresponding object. ) Wrapper (a) String pee a 2022) (c) System 16. Keyword to create an object ofa class is__—— sed to convert @ primitive data (a) create (b) new (c) New (anew ICSE 2022) 17. A_______method needs tobe called with the help ofan object. (a) void (b) return (d) static (ICSE 2022) (c) non-static 18. Parameters used in the method call statement are (a) Actual parameters (b) Informal parameters (d) Void parameters (c) Formal parameters (ICSE 2022) 19. (a) Identify the names of class variables and instance variables from code given below : class abe t static float a=5.0f; int b=20; } (b) From the above class and below code, find the output : abc ob1=new abe( }; obl.a+=20; ob1.b-=10; System.out.printin(ob1. a+"\t" + ob1.b); abc.ob2=new abel ); ob2.a+=50; ob2.b=90; System.out.printIn(ob2.a +‘\t" +0b2.b); 108 en ces give output of the following program segment : 2 * ass ae { ; gia int joat bs wll abe(int x, float y) {a= si static woud main) Pp - oblenew abcl4, 8.5f); abe ob2=neW abc (obl.a +6, 2.5f); gystemout.printin(ob La +"\t'+ ob1.b); gystem-out.printin(ob2.a +"\t"+ 0b2.b); } class Assumption = 21. { private char S; private static int a; public int total ‘Assumption( ) (i) Write a statement to create an object of class Assumption in public static void main( ). (ii) Write a statement to display the value of s and total in public static void main( ). (iii) Write a statement to display the value of a in public static void main( ). 22. class xyz { static float x; } There are two ways to assign a value 5.5 to the static variable x mentioned above in public static void main( ). Write the two Java statements for the same, 23. Write a difference between a class and an object.

You might also like