SlideShare a Scribd company logo
1 of 18
Download to read offline
Project Report
Java Programming
Information Technology
Topic
Wrapper Class and
Nesting of Methods
Submitted By
Deepika Mittal
BCA IInd Year
Dezyne E’cole College
www.dezyneecole.com
R
Project Report
On
Java Programming
At
Dezyne E’cole College
Ajmer
Submitted to
Dezyne E’cole College
Towards The
Partial Fulfillment on
Bachelor’s of Computer Application
By
Deepika Mittal
Dezyne E’cole College
106/10, Civil line, Ajmer
Tel:–0145-2624679
www.dezyneecole.com
2016-17
R
ACKNOWLEDGMENT
I Deepika Mittal, Student of Dezyne E’cole College, an Externally Grateful
To Each and Every Individual Who Has Contributed In Successful
Completion of My Project. I Express My Gratitude Towards Dezyne E’cole
College For Their Guidance And Constant Supervision As Well As For
Providing The Necessary Information And Support Regarding The
Completion of Project.
Thank You
SYNOPSIS
This Project is a Miner Project Mode, Based on the Theoretical Concepts
of Java. This Project Has Made our Basic Concepts on Java Strong.
Q. What is wrapper class and Methods of Nesting?
Ans.
Wrapper Classes
As pointed out earlier. Vector cannot handle primitive data types like int, float, char, and double.
Primitive data type may be converted into object types by using the wrapper classes contained
in the java.lang Package. Following table shows the simple data types and their corresponding
wrapper class types.
 Wrapper Classes For Converting Types:-
Simple Type Wrapper Class
Boolean Boolean
Char Character
Double Double
Float Float
Int Integer
Long Long
The wrapper classes have a number of unique methods for handling primitive data type and
objects. They are listed in the following tables.
 Converting Primitive Numbers to Object Number Using Constructor
Method:-
Constructor Calling Conversion Action
Integer IntVal=new Integer(i); Primitive integer to Integer Object
Float FloatVal=new Float(f); Primitive float to Float Object
Double DoubleVal=new Double(d); Primitive double to Double Object
Long LongVal=new Long(l); Primitive long to Long Object
 Converting Object Numbers to Primitive Number Using typeValue()
Method:-
Method Calling Conversion Action
int i=IntVal.intValue(); Object to Primitive integer
float f=FloatVal.floatValue(); Object to Primitive float
long l=LongVal.longValue(); Object to Primitive long
double d=DoubleVal.doubleValue(); Object to Primitive double
 Converting Numbers to String Using to String () Method:-
Method Calling Conversion Action
str= Integer.toString(i); Primitive integer to string
str= Float.toString(f); Primitive float to string
str= Double.toString(d); Primitive double to string
str= Long.toString(l); Primitive long to string
 Converting String Objects to Numbers Objects Using the Static Method
valueOf ():-
Method Calling Conversion Action
DoubleVal = Double.ValueOf(str); Converts string to Double object
FloatVal = Float.ValueOf(str); Converts string to Float object
IntegerVal = Integer.ValueOf(str); Converts string to Integer object
LongVal = Long.ValueOf(str); Converts string to Long object
 Converting Numeric String to Primitive Numbers Using Parsing Methods:-
Method Calling Conversion Action
int i= Integer parseInt(str); Converts string to primitive integer
long l= Long parseLong(str); Converts string to primitive long
1. Converting Primitive Numbers to Object Numbers
2. Converting Object Numbers to Primitive Numbers
3. Converting Numbers to String
4. Convert String Object to Numeric Object
5. Converting Numeric String to Primitive Numbers
Autoboxing and Unboxing
The Autoboxing and unboxing feature, introduced in J2SE 5.0, facilitates the process of handling
primitive data types in collections. We can use this feature to convert primitive data types to
wrapper class types automatically. The compiler generates a code implicitly to convert primitive
type to the corresponding wrapper class type and vice-versa. For example, consider the following
statements:
Double d = 98.42;
double dbl = d.doubleValue();
Using the Autoboxing and Unboxing feature, we can rewrite the above code as
:-
Double d = 98.42;
double dbl = d;
How, the java compiler provides restrictions to perform the following conversion:-
 Convert from null type to any primitive type.
 Convert to the null type other than the identify conversion.
 Convert from any class type C to any array type if C is not object.
1. Vector Without using Autoboxing and Unboxing
2. Vector With using Autoboxing and Unboxing
Nesting of Methods
We discussed earlier that a method of a class can be called only by an object of that class (or class
itself, in the case of static methods) using the dot operator. However, there is an exception to
this. A method can be called by using only its name by another method of the same class. This is
known as nesting of methods.
Program illustrates the nesting of methods inside a class. The class Nesting defines one
constructor and two methods, namely largest () and display (). The method display () calls the
method largest () to determine the largest of the two numbers and then displays the result.
1. Nesting of Methods
2. Another Example
A method can call any number of methods. It is also possible for a called method to call another
method. That is, method1 may call method2, which in turn may call method3.
Thank you

More Related Content

What's hot

What's hot (20)

Aanchal Gupta,BCA 2nd year
Aanchal Gupta,BCA 2nd yearAanchal Gupta,BCA 2nd year
Aanchal Gupta,BCA 2nd year
 
Sudarshan Joshi,BCA 2nd Year
Sudarshan Joshi,BCA 2nd Year Sudarshan Joshi,BCA 2nd Year
Sudarshan Joshi,BCA 2nd Year
 
Bhanu Pratap Singh ,BCA
Bhanu Pratap Singh ,BCA Bhanu Pratap Singh ,BCA
Bhanu Pratap Singh ,BCA
 
Reshma Kodwani,BCA,2nd Year
Reshma Kodwani,BCA,2nd YearReshma Kodwani,BCA,2nd Year
Reshma Kodwani,BCA,2nd Year
 
Shaikh Mohammad Usman Haider ,BCA 2nd Year
Shaikh Mohammad Usman Haider ,BCA 2nd Year Shaikh Mohammad Usman Haider ,BCA 2nd Year
Shaikh Mohammad Usman Haider ,BCA 2nd Year
 
Nikita Totlani ,BCA 2nd year
Nikita Totlani ,BCA 2nd year Nikita Totlani ,BCA 2nd year
Nikita Totlani ,BCA 2nd year
 
Kajal Gaharwal,BCA 2nd Year
Kajal Gaharwal,BCA 2nd YearKajal Gaharwal,BCA 2nd Year
Kajal Gaharwal,BCA 2nd Year
 
Ravi Sharma,BCA 2nd Year
Ravi Sharma,BCA 2nd YearRavi Sharma,BCA 2nd Year
Ravi Sharma,BCA 2nd Year
 
Ram Prasad ,BCA 2nd Year
Ram Prasad ,BCA 2nd YearRam Prasad ,BCA 2nd Year
Ram Prasad ,BCA 2nd Year
 
Pooja Sharma ,BCA 2nd Year
Pooja Sharma ,BCA 2nd YearPooja Sharma ,BCA 2nd Year
Pooja Sharma ,BCA 2nd Year
 
Yashika Soni, BCA 2nd Year
Yashika Soni, BCA 2nd YearYashika Soni, BCA 2nd Year
Yashika Soni, BCA 2nd Year
 
Shivani Chouhan ,BCA ,2nd Year
Shivani Chouhan ,BCA ,2nd YearShivani Chouhan ,BCA ,2nd Year
Shivani Chouhan ,BCA ,2nd Year
 
Daksh Sharma ,BCA 2nd Year
Daksh  Sharma ,BCA 2nd YearDaksh  Sharma ,BCA 2nd Year
Daksh Sharma ,BCA 2nd Year
 
Mithlesh Singh Rawat, BCA 2nd Year
Mithlesh Singh Rawat, BCA 2nd Year Mithlesh Singh Rawat, BCA 2nd Year
Mithlesh Singh Rawat, BCA 2nd Year
 
Brijesh Peswani,BCA 2nd Year
Brijesh Peswani,BCA 2nd YearBrijesh Peswani,BCA 2nd Year
Brijesh Peswani,BCA 2nd Year
 
Deepak Soni,BCA 2nd Year
Deepak Soni,BCA 2nd YearDeepak Soni,BCA 2nd Year
Deepak Soni,BCA 2nd Year
 
Rahul Saini, BCA 2nd Year
Rahul Saini, BCA 2nd YearRahul Saini, BCA 2nd Year
Rahul Saini, BCA 2nd Year
 
Varun Kaushik, BCA 2nd Year
Varun Kaushik, BCA 2nd YearVarun Kaushik, BCA 2nd Year
Varun Kaushik, BCA 2nd Year
 
Farhaan Ahmed, BCA 2nd Year
Farhaan Ahmed, BCA 2nd YearFarhaan Ahmed, BCA 2nd Year
Farhaan Ahmed, BCA 2nd Year
 
Harendra Singh Rawat,BCA 2nd Year
Harendra Singh Rawat,BCA 2nd YearHarendra Singh Rawat,BCA 2nd Year
Harendra Singh Rawat,BCA 2nd Year
 

Viewers also liked

Tanu Chourasiya,B.Sc fashion Technology+2 years Diploma
Tanu Chourasiya,B.Sc fashion Technology+2 years Diploma Tanu Chourasiya,B.Sc fashion Technology+2 years Diploma
Tanu Chourasiya,B.Sc fashion Technology+2 years Diploma
dezyneecole
 
Heena Soni,B.Sc-fashion Technology+2 years Diploma
Heena Soni,B.Sc-fashion Technology+2 years Diploma Heena Soni,B.Sc-fashion Technology+2 years Diploma
Heena Soni,B.Sc-fashion Technology+2 years Diploma
dezyneecole
 
Heena Soni,B.Sc fashion Technology+2 years Diploma
 Heena Soni,B.Sc fashion Technology+2 years Diploma Heena Soni,B.Sc fashion Technology+2 years Diploma
Heena Soni,B.Sc fashion Technology+2 years Diploma
dezyneecole
 

Viewers also liked (17)

Shipra khandelwal,B.Sc-Fashion Technology
Shipra khandelwal,B.Sc-Fashion Technology Shipra khandelwal,B.Sc-Fashion Technology
Shipra khandelwal,B.Sc-Fashion Technology
 
interior design student work
interior design student workinterior design student work
interior design student work
 
Podcast
PodcastPodcast
Podcast
 
Tanupriya Bhati,B.Sc-Fashion Technology
Tanupriya Bhati,B.Sc-Fashion TechnologyTanupriya Bhati,B.Sc-Fashion Technology
Tanupriya Bhati,B.Sc-Fashion Technology
 
Pratigya Bhatnagar,B.Sc.-Fashion Technology+2 years Diploma
Pratigya Bhatnagar,B.Sc.-Fashion Technology+2 years Diploma Pratigya Bhatnagar,B.Sc.-Fashion Technology+2 years Diploma
Pratigya Bhatnagar,B.Sc.-Fashion Technology+2 years Diploma
 
Tanu Chourasiya,B.Sc fashion Technology+2 years Diploma
Tanu Chourasiya,B.Sc fashion Technology+2 years Diploma Tanu Chourasiya,B.Sc fashion Technology+2 years Diploma
Tanu Chourasiya,B.Sc fashion Technology+2 years Diploma
 
Farman Aslam ,B.Sc-Fashion Design +2years diploma in womens wear Portfoilo
Farman Aslam ,B.Sc-Fashion Design +2years diploma in womens wear PortfoiloFarman Aslam ,B.Sc-Fashion Design +2years diploma in womens wear Portfoilo
Farman Aslam ,B.Sc-Fashion Design +2years diploma in womens wear Portfoilo
 
Tanupriya Bhati,B.Sc-Fashion Technology
Tanupriya Bhati,B.Sc-Fashion Technology Tanupriya Bhati,B.Sc-Fashion Technology
Tanupriya Bhati,B.Sc-Fashion Technology
 
Heena srivastav ,M.Sc-Fashion Technology
Heena srivastav ,M.Sc-Fashion TechnologyHeena srivastav ,M.Sc-Fashion Technology
Heena srivastav ,M.Sc-Fashion Technology
 
Heena Soni,B.Sc-fashion Technology+2 years Diploma
Heena Soni,B.Sc-fashion Technology+2 years Diploma Heena Soni,B.Sc-fashion Technology+2 years Diploma
Heena Soni,B.Sc-fashion Technology+2 years Diploma
 
Heena Soni,B.Sc fashion Technology+2 years Diploma
 Heena Soni,B.Sc fashion Technology+2 years Diploma Heena Soni,B.Sc fashion Technology+2 years Diploma
Heena Soni,B.Sc fashion Technology+2 years Diploma
 
Aksay Sharma,B.Sc-fashion Technology ,+ 2 years diploma
 Aksay Sharma,B.Sc-fashion Technology ,+ 2 years diploma  Aksay Sharma,B.Sc-fashion Technology ,+ 2 years diploma
Aksay Sharma,B.Sc-fashion Technology ,+ 2 years diploma
 
Ayushi khilani B.Sc -fashion Design + One Year Womens Wear Portfolio
Ayushi khilani B.Sc -fashion Design + One Year Womens Wear PortfolioAyushi khilani B.Sc -fashion Design + One Year Womens Wear Portfolio
Ayushi khilani B.Sc -fashion Design + One Year Womens Wear Portfolio
 
Nisha Parwani B.Sc Interior design Student Work
Nisha Parwani B.Sc Interior design Student WorkNisha Parwani B.Sc Interior design Student Work
Nisha Parwani B.Sc Interior design Student Work
 
Mamta Manwani,Fashion Designer
Mamta Manwani,Fashion DesignerMamta Manwani,Fashion Designer
Mamta Manwani,Fashion Designer
 
Heena Soni,B.Sc fashion Technology+2 years Diploma
 Heena Soni,B.Sc fashion Technology+2 years Diploma Heena Soni,B.Sc fashion Technology+2 years Diploma
Heena Soni,B.Sc fashion Technology+2 years Diploma
 
Colours - Bahan Ajar Bahasa Inggris SD
Colours - Bahan Ajar Bahasa Inggris SDColours - Bahan Ajar Bahasa Inggris SD
Colours - Bahan Ajar Bahasa Inggris SD
 

Similar to Deepika Mittal,BCA ,2nd Year

Presentation 4th
Presentation 4thPresentation 4th
Presentation 4th
Connex
 

Similar to Deepika Mittal,BCA ,2nd Year (11)

Wrapper classes
Wrapper classesWrapper classes
Wrapper classes
 
Gaurav Singh Chouhan, BCA 2nd Year
Gaurav Singh Chouhan, BCA 2nd YearGaurav Singh Chouhan, BCA 2nd Year
Gaurav Singh Chouhan, BCA 2nd Year
 
BCA 2nd year Java prog. File
BCA 2nd year Java prog. FileBCA 2nd year Java prog. File
BCA 2nd year Java prog. File
 
Pooja Sharma , BCA Third Year
Pooja Sharma , BCA Third YearPooja Sharma , BCA Third Year
Pooja Sharma , BCA Third Year
 
Kirti Kumawat
Kirti KumawatKirti Kumawat
Kirti Kumawat
 
Samarth Gaur ,BCA 2nd Year
Samarth Gaur ,BCA 2nd YearSamarth Gaur ,BCA 2nd Year
Samarth Gaur ,BCA 2nd Year
 
Akshay Sharma,BCA,2nd year
Akshay Sharma,BCA,2nd yearAkshay Sharma,BCA,2nd year
Akshay Sharma,BCA,2nd year
 
Ravi Prakash,BCA,2nd Year
Ravi Prakash,BCA,2nd YearRavi Prakash,BCA,2nd Year
Ravi Prakash,BCA,2nd Year
 
Presentation 4th
Presentation 4thPresentation 4th
Presentation 4th
 
22316-2019-Summer-model-answer-paper.pdf
22316-2019-Summer-model-answer-paper.pdf22316-2019-Summer-model-answer-paper.pdf
22316-2019-Summer-model-answer-paper.pdf
 
Getting Started - Console Program and Problem Solving
Getting Started - Console Program and Problem SolvingGetting Started - Console Program and Problem Solving
Getting Started - Console Program and Problem Solving
 

More from dezyneecole

More from dezyneecole (20)

Gracika Benjamin , Diploma Fashion Design Second Year
Gracika Benjamin , Diploma Fashion Design Second YearGracika Benjamin , Diploma Fashion Design Second Year
Gracika Benjamin , Diploma Fashion Design Second Year
 
Sheikh Anjum Firdoush , Diploma Fashion Design Second Year
Sheikh Anjum Firdoush , Diploma Fashion Design Second YearSheikh Anjum Firdoush , Diploma Fashion Design Second Year
Sheikh Anjum Firdoush , Diploma Fashion Design Second Year
 
Harsha Chhaparwal, Diploma Fashion Design Second Year
Harsha Chhaparwal, Diploma Fashion Design Second YearHarsha Chhaparwal, Diploma Fashion Design Second Year
Harsha Chhaparwal, Diploma Fashion Design Second Year
 
Harsha Chhaparwal, Diploma Fashion Design Second Year
Harsha Chhaparwal, Diploma Fashion Design Second YearHarsha Chhaparwal, Diploma Fashion Design Second Year
Harsha Chhaparwal, Diploma Fashion Design Second Year
 
Harsha Chhaparwal, Diploma Fashion Design Second Year
Harsha Chhaparwal, Diploma Fashion Design Second YearHarsha Chhaparwal, Diploma Fashion Design Second Year
Harsha Chhaparwal, Diploma Fashion Design Second Year
 
Sheikh Anjum Firdoush , Diploma Fashion Design Second Year
Sheikh Anjum Firdoush , Diploma Fashion Design Second YearSheikh Anjum Firdoush , Diploma Fashion Design Second Year
Sheikh Anjum Firdoush , Diploma Fashion Design Second Year
 
Sushmita Bhati, Diploma Fashion Design Second Year
Sushmita Bhati, Diploma Fashion Design Second YearSushmita Bhati, Diploma Fashion Design Second Year
Sushmita Bhati, Diploma Fashion Design Second Year
 
Sushmita Bhati, Diploma Fashion Design Second Year
Sushmita Bhati, Diploma Fashion Design Second YearSushmita Bhati, Diploma Fashion Design Second Year
Sushmita Bhati, Diploma Fashion Design Second Year
 
Sushmita Bhati, Diploma Fashion Design Second Year, (How to Design for Fashio...
Sushmita Bhati, Diploma Fashion Design Second Year, (How to Design for Fashio...Sushmita Bhati, Diploma Fashion Design Second Year, (How to Design for Fashio...
Sushmita Bhati, Diploma Fashion Design Second Year, (How to Design for Fashio...
 
Somya Jain, Diploma Fashion Design Second Year, (How to Design for Fashion In...
Somya Jain, Diploma Fashion Design Second Year, (How to Design for Fashion In...Somya Jain, Diploma Fashion Design Second Year, (How to Design for Fashion In...
Somya Jain, Diploma Fashion Design Second Year, (How to Design for Fashion In...
 
Gitesh Chhatwani , BCA -3 Year
Gitesh Chhatwani , BCA -3 YearGitesh Chhatwani , BCA -3 Year
Gitesh Chhatwani , BCA -3 Year
 
Anurag Yadav , B.Voc Interior Design 1st Year ( Residential Portfolio)
Anurag Yadav , B.Voc Interior Design 1st Year ( Residential Portfolio)Anurag Yadav , B.Voc Interior Design 1st Year ( Residential Portfolio)
Anurag Yadav , B.Voc Interior Design 1st Year ( Residential Portfolio)
 
Namita Bakoliya, Diploma Fashion Design First Year, (Corel Draw Project)
Namita Bakoliya, Diploma Fashion Design First Year, (Corel Draw Project)Namita Bakoliya, Diploma Fashion Design First Year, (Corel Draw Project)
Namita Bakoliya, Diploma Fashion Design First Year, (Corel Draw Project)
 
Sheikh Anjum Firdoush , Diploma Fashion Design Second Year, (Pattern Engineer...
Sheikh Anjum Firdoush , Diploma Fashion Design Second Year, (Pattern Engineer...Sheikh Anjum Firdoush , Diploma Fashion Design Second Year, (Pattern Engineer...
Sheikh Anjum Firdoush , Diploma Fashion Design Second Year, (Pattern Engineer...
 
Sheikh Anjum Firdoush , Diploma Fashion Design Second Year, (Draping Project)
Sheikh Anjum Firdoush , Diploma Fashion Design Second Year, (Draping Project)Sheikh Anjum Firdoush , Diploma Fashion Design Second Year, (Draping Project)
Sheikh Anjum Firdoush , Diploma Fashion Design Second Year, (Draping Project)
 
Gouri Ramchandani, Diploma Fashion Design First Year, (Embroidery Project)
Gouri Ramchandani, Diploma Fashion Design First Year, (Embroidery Project)Gouri Ramchandani, Diploma Fashion Design First Year, (Embroidery Project)
Gouri Ramchandani, Diploma Fashion Design First Year, (Embroidery Project)
 
Gouri Ramchandani, Diploma Fashion Design First Year, (Corel DrawProject)
Gouri Ramchandani, Diploma Fashion Design First Year, (Corel DrawProject)Gouri Ramchandani, Diploma Fashion Design First Year, (Corel DrawProject)
Gouri Ramchandani, Diploma Fashion Design First Year, (Corel DrawProject)
 
Dimple Mordani, Diploma Fashion Design First Year, (illustration for Fashion ...
Dimple Mordani, Diploma Fashion Design First Year, (illustration for Fashion ...Dimple Mordani, Diploma Fashion Design First Year, (illustration for Fashion ...
Dimple Mordani, Diploma Fashion Design First Year, (illustration for Fashion ...
 
Dimple Mordani, Diploma Fashion Design First Year, (Design Basics Project)
Dimple Mordani, Diploma Fashion Design First Year, (Design Basics Project)Dimple Mordani, Diploma Fashion Design First Year, (Design Basics Project)
Dimple Mordani, Diploma Fashion Design First Year, (Design Basics Project)
 
Dimple Mordani, Diploma Fashion Design First Year, (Corel Draw Project)
Dimple Mordani, Diploma Fashion Design First Year, (Corel Draw Project)Dimple Mordani, Diploma Fashion Design First Year, (Corel Draw Project)
Dimple Mordani, Diploma Fashion Design First Year, (Corel Draw Project)
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Recently uploaded (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

Deepika Mittal,BCA ,2nd Year

  • 1. Project Report Java Programming Information Technology Topic Wrapper Class and Nesting of Methods Submitted By Deepika Mittal BCA IInd Year Dezyne E’cole College www.dezyneecole.com R
  • 2. Project Report On Java Programming At Dezyne E’cole College Ajmer Submitted to Dezyne E’cole College Towards The Partial Fulfillment on Bachelor’s of Computer Application By Deepika Mittal Dezyne E’cole College 106/10, Civil line, Ajmer Tel:–0145-2624679 www.dezyneecole.com 2016-17 R
  • 3. ACKNOWLEDGMENT I Deepika Mittal, Student of Dezyne E’cole College, an Externally Grateful To Each and Every Individual Who Has Contributed In Successful Completion of My Project. I Express My Gratitude Towards Dezyne E’cole College For Their Guidance And Constant Supervision As Well As For Providing The Necessary Information And Support Regarding The Completion of Project. Thank You
  • 4. SYNOPSIS This Project is a Miner Project Mode, Based on the Theoretical Concepts of Java. This Project Has Made our Basic Concepts on Java Strong.
  • 5. Q. What is wrapper class and Methods of Nesting? Ans. Wrapper Classes As pointed out earlier. Vector cannot handle primitive data types like int, float, char, and double. Primitive data type may be converted into object types by using the wrapper classes contained in the java.lang Package. Following table shows the simple data types and their corresponding wrapper class types.  Wrapper Classes For Converting Types:- Simple Type Wrapper Class Boolean Boolean Char Character Double Double Float Float Int Integer Long Long The wrapper classes have a number of unique methods for handling primitive data type and objects. They are listed in the following tables.  Converting Primitive Numbers to Object Number Using Constructor Method:- Constructor Calling Conversion Action Integer IntVal=new Integer(i); Primitive integer to Integer Object Float FloatVal=new Float(f); Primitive float to Float Object Double DoubleVal=new Double(d); Primitive double to Double Object Long LongVal=new Long(l); Primitive long to Long Object  Converting Object Numbers to Primitive Number Using typeValue() Method:- Method Calling Conversion Action int i=IntVal.intValue(); Object to Primitive integer float f=FloatVal.floatValue(); Object to Primitive float long l=LongVal.longValue(); Object to Primitive long double d=DoubleVal.doubleValue(); Object to Primitive double
  • 6.  Converting Numbers to String Using to String () Method:- Method Calling Conversion Action str= Integer.toString(i); Primitive integer to string str= Float.toString(f); Primitive float to string str= Double.toString(d); Primitive double to string str= Long.toString(l); Primitive long to string  Converting String Objects to Numbers Objects Using the Static Method valueOf ():- Method Calling Conversion Action DoubleVal = Double.ValueOf(str); Converts string to Double object FloatVal = Float.ValueOf(str); Converts string to Float object IntegerVal = Integer.ValueOf(str); Converts string to Integer object LongVal = Long.ValueOf(str); Converts string to Long object  Converting Numeric String to Primitive Numbers Using Parsing Methods:- Method Calling Conversion Action int i= Integer parseInt(str); Converts string to primitive integer long l= Long parseLong(str); Converts string to primitive long
  • 7. 1. Converting Primitive Numbers to Object Numbers
  • 8. 2. Converting Object Numbers to Primitive Numbers
  • 10. 4. Convert String Object to Numeric Object
  • 11. 5. Converting Numeric String to Primitive Numbers
  • 12. Autoboxing and Unboxing The Autoboxing and unboxing feature, introduced in J2SE 5.0, facilitates the process of handling primitive data types in collections. We can use this feature to convert primitive data types to wrapper class types automatically. The compiler generates a code implicitly to convert primitive type to the corresponding wrapper class type and vice-versa. For example, consider the following statements: Double d = 98.42; double dbl = d.doubleValue(); Using the Autoboxing and Unboxing feature, we can rewrite the above code as :- Double d = 98.42; double dbl = d; How, the java compiler provides restrictions to perform the following conversion:-  Convert from null type to any primitive type.  Convert to the null type other than the identify conversion.  Convert from any class type C to any array type if C is not object.
  • 13. 1. Vector Without using Autoboxing and Unboxing
  • 14. 2. Vector With using Autoboxing and Unboxing
  • 15. Nesting of Methods We discussed earlier that a method of a class can be called only by an object of that class (or class itself, in the case of static methods) using the dot operator. However, there is an exception to this. A method can be called by using only its name by another method of the same class. This is known as nesting of methods. Program illustrates the nesting of methods inside a class. The class Nesting defines one constructor and two methods, namely largest () and display (). The method display () calls the method largest () to determine the largest of the two numbers and then displays the result.
  • 16. 1. Nesting of Methods
  • 17. 2. Another Example A method can call any number of methods. It is also possible for a called method to call another method. That is, method1 may call method2, which in turn may call method3.