SlideShare a Scribd company logo
1 of 42
Download to read offline
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 1
Que 1 : What is a Classes?
A: classes are group of data member and member function.
Syntax :
Class classname // instance class (local – class)
{
Field Declaration ; // instance variable declaration
Methods Declaration; // instance methods declaration
}
Class classname
{
Public static void main(String s[ ])
{
Body of the code;
}
}
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 2
Que 2: What is a Instance Variable?
A: Instance variables are variables within a class but outside any method.
These variables are instantiated when the class is loaded.
Syntax :
Class classname
{
Field Declaration ; // instance variable declaration
Methods Declaration; // instance methods declaration
}
Que 3: What is Class Variable?
A: These variables are declared with in a class, outside any method, with the
static keyword.
Que 4: What is Local Variable?
A: Variables defined inside methods, constructors or blocks are called local
variables. The variable will be declared and initialized within the method and
it will be destroyed when the method has completed.
Que 5: What is Object?
A: An object is runtime entity of the real world.
An object in java are create using the ‘ new ‘ operator.
Syntax :
Classname objectname = new classname( );
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 3
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 4
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 5
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 6
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 7
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 8
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 9
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 10
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 11
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 12
}
}
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 13
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 14
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 15
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 16
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 17
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 18
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 19
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 20
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 21
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 22
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 23
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 24
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 25
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 26
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 27
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 28
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 29
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 30
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 31
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 32
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 33
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 34
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 35
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 36
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 37
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 38
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 39
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 40
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 41
Fill in the blanks in each of the following statements:
a) Lists and tables of values can be stored in .
ANS: arrays.
b) The elements of an array are related by the fact that they normally
have the same
.
ANS: type. [Note: In the book, the answer is incorrectly stated to be
“name.”]
c) The number used to refer to a particular element of an array is called
its .
ANS: subscript.
d) The process of putting the elements of an array in order is called the
array.
ANS: sorting.
e) Determining whether an array contains a certain key value is called the
array.
ANS: searching.
f) An array that uses two subscripts is referred to as a(n) array.
ANS: two-dimensional.
10.2 State whether each of the following is true or false. If false, explain
why.
a) An array can store many different types of values.
ANS: True.
b) An array subscript should normally be a floating-point value.
ANS: False. An array subscript must be an integer or an integer
expression.
c) An individual array element that is passed to a function and modified in
it will contain the modified value when the called function completes
execution.
ANS: False. Individual primitive-data-type elements are passed by value.
If a reference to
an array is passed, then modifications to the elements of the array are
reflected in the
SMT. K K PATEL MBA / MCA COLLEGE
PINKESH MODI (MCA) PAGE NO : 42
original element of the array. Also, an individual element of an object type
passed to
a function is passed by reference, and changes to the object will be
reflected in the
original array element.

More Related Content

Similar to Unit 1 java programmin second part

variables, values and expressions
   variables, values and expressions   variables, values and expressions
variables, values and expressionsKopi Maheswaran
 
Smu mca sem 4 winter 2016 assignments
Smu mca sem 4 winter 2016 assignmentsSmu mca sem 4 winter 2016 assignments
Smu mca sem 4 winter 2016 assignmentssolved_assignments
 
Smu mca sem 4 fall 2016 assignments
Smu mca sem 4 fall 2016 assignmentsSmu mca sem 4 fall 2016 assignments
Smu mca sem 4 fall 2016 assignmentssolved_assignments
 
Smu mca sem 4 fall 2015 assignments
Smu mca sem 4 fall 2015 assignmentsSmu mca sem 4 fall 2015 assignments
Smu mca sem 4 fall 2015 assignmentssolved_assignments
 

Similar to Unit 1 java programmin second part (6)

Compiler Questions
Compiler QuestionsCompiler Questions
Compiler Questions
 
variables, values and expressions
   variables, values and expressions   variables, values and expressions
variables, values and expressions
 
handout6.pdf
handout6.pdfhandout6.pdf
handout6.pdf
 
Smu mca sem 4 winter 2016 assignments
Smu mca sem 4 winter 2016 assignmentsSmu mca sem 4 winter 2016 assignments
Smu mca sem 4 winter 2016 assignments
 
Smu mca sem 4 fall 2016 assignments
Smu mca sem 4 fall 2016 assignmentsSmu mca sem 4 fall 2016 assignments
Smu mca sem 4 fall 2016 assignments
 
Smu mca sem 4 fall 2015 assignments
Smu mca sem 4 fall 2015 assignmentsSmu mca sem 4 fall 2015 assignments
Smu mca sem 4 fall 2015 assignments
 

Recently uploaded

MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinojohnmickonozaleda
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 

Recently uploaded (20)

MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipino
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 

Unit 1 java programmin second part

  • 1. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 1 Que 1 : What is a Classes? A: classes are group of data member and member function. Syntax : Class classname // instance class (local – class) { Field Declaration ; // instance variable declaration Methods Declaration; // instance methods declaration } Class classname { Public static void main(String s[ ]) { Body of the code; } }
  • 2. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 2 Que 2: What is a Instance Variable? A: Instance variables are variables within a class but outside any method. These variables are instantiated when the class is loaded. Syntax : Class classname { Field Declaration ; // instance variable declaration Methods Declaration; // instance methods declaration } Que 3: What is Class Variable? A: These variables are declared with in a class, outside any method, with the static keyword. Que 4: What is Local Variable? A: Variables defined inside methods, constructors or blocks are called local variables. The variable will be declared and initialized within the method and it will be destroyed when the method has completed. Que 5: What is Object? A: An object is runtime entity of the real world. An object in java are create using the ‘ new ‘ operator. Syntax : Classname objectname = new classname( );
  • 3. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 3
  • 4. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 4
  • 5. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 5
  • 6. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 6
  • 7. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 7
  • 8. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 8
  • 9. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 9
  • 10. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 10
  • 11. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 11
  • 12. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 12 } }
  • 13. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 13
  • 14. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 14
  • 15. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 15
  • 16. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 16
  • 17. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 17
  • 18. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 18
  • 19. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 19
  • 20. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 20
  • 21. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 21
  • 22. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 22
  • 23. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 23
  • 24. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 24
  • 25. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 25
  • 26. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 26
  • 27. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 27
  • 28. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 28
  • 29. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 29
  • 30. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 30
  • 31. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 31
  • 32. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 32
  • 33. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 33
  • 34. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 34
  • 35. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 35
  • 36. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 36
  • 37. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 37
  • 38. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 38
  • 39. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 39
  • 40. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 40
  • 41. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 41 Fill in the blanks in each of the following statements: a) Lists and tables of values can be stored in . ANS: arrays. b) The elements of an array are related by the fact that they normally have the same . ANS: type. [Note: In the book, the answer is incorrectly stated to be “name.”] c) The number used to refer to a particular element of an array is called its . ANS: subscript. d) The process of putting the elements of an array in order is called the array. ANS: sorting. e) Determining whether an array contains a certain key value is called the array. ANS: searching. f) An array that uses two subscripts is referred to as a(n) array. ANS: two-dimensional. 10.2 State whether each of the following is true or false. If false, explain why. a) An array can store many different types of values. ANS: True. b) An array subscript should normally be a floating-point value. ANS: False. An array subscript must be an integer or an integer expression. c) An individual array element that is passed to a function and modified in it will contain the modified value when the called function completes execution. ANS: False. Individual primitive-data-type elements are passed by value. If a reference to an array is passed, then modifications to the elements of the array are reflected in the
  • 42. SMT. K K PATEL MBA / MCA COLLEGE PINKESH MODI (MCA) PAGE NO : 42 original element of the array. Also, an individual element of an object type passed to a function is passed by reference, and changes to the object will be reflected in the original array element.