what is object type casting? give some example with related?
Answer Posted / aaratim
Object type casting is converting a object type into another
type. For example
Iterator ite = emplist.iterator();
while(ite.hasNext()){
Employee empObj = (Employee)ite.next();
}
Here ite.next returns instance of type Object, we need to
convert it to type Employee so this is called type casting.
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
In how many ways we can do exception handling in java?
What is object in java?
Why do we need hashmap in java?
When can you say a graph to be a tree?
What is the difference between exception and error in java?
What class allows you to read objects directly from a stream in java programming?
What is identifier give example?
How big is a 64 bit float?
What is qualitative variable?
How can you generate random numbers in java?
What is the difference between variable declaration and variable initialization?
What are bind parameters?
What do you understand by java?
What are design patterns and please explain?
Which programming language is most secure?