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
What do you mean by Hash Map and Hash Table?
What does this mean java?
What are the advantages of defining packages in java?
What is a hashmap used for?
Explain Basics of OOP Language in java
what is instanceof operator used in java?
Give reasons supporting that string is immutable.
What is the finalize method do?
How do you define a parameter?
What are class members by default?
What is object cloning in Java?
What are register variables what are the advantages?
How to sort double array in java?
How to sort array in descending order in java?
How do you know if a value is nan?