Trending ▼   ResFinder  

ICSE Class X Notes 2020 : Computer Applications : Constructor test

3 pages, 4 questions, 0 questions with responses, 0 total responses,    0    0
Ani Raj
 Bangalore 
+Fave Message
 Home > ananthinaga >

Formatting page ...

1) What is a constructor and what is its use? [2] 2) Given the following code, answer the questions that follow: [3] class Academic { int x,y; void access( ) { int a,b; Academic student = new Academic( ); System.out.println( Object created ); } } (i) What is the object name of class Academic? (ii) Name the class variable used in this program. (iii) Write the local variable used in this program. 3) What are the (any 2)Rules in defining a constructor?[2] 4) State the difference between Constructor and Method. [2] 5) Create a class with one integer instance variable. Initialize the variable using [2] i. default constructor ii. parameterized constructor. 6) What is Parameterized constructor? [2] 7) Explain Copy constructor? [2] 8) Why do we need a constructor as a class member?[2] 9) How many constructors can a class have?[1] 10) Define a parameterized constructor for the class Floppy that assigns the diameter and storage space passed to it to the member variable diameter and space .[2]

Formatting page ...

Formatting page ...

 

  Print intermediate debugging step

Show debugging info


 

 

© 2010 - 2024 ResPaper. Terms of ServiceContact Us Advertise with us

 

ananthinaga chat