Solved

casting and autoboxing differences and similarities in java

Posted on 2014-11-12
2
445 Views
Last Modified: 2014-11-14
hi,

I would like to know "casting and autoboxing differences and similarities in java". When to use which one with practical examples. Thanks in advance.
0
Comment
Question by:gudii9
2 Comments
 
LVL 35

Accepted Solution

by:
girionis earned 250 total points
ID: 40439387
Casting is when you convert an object type to another object type. For example you convert an "Integer" to a "Number".

Autoboxing is when you convert a primitive to an object. For example you convert an "int" to an "Integer".
0
 
LVL 20

Assisted Solution

by:Sathish David Kumar N
Sathish David  Kumar N earned 250 total points
ID: 40439468
Boxing is when you convert a primitive type to a reference type,
(only between primitive type and wraaper classes )



Casting is when you want one type to be treated as another type (its may be a your own class _)
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
java stored proc example 9 44
hibernate example using maven 12 57
String array comparison 4 38
Using jdbcTemplate.batchUpdate to improve INSERT performance 6 22
This article will show, step by step, how to integrate R code into a R Sweave document
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
This video teaches viewers about errors in exception handling.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question