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 is polymorphism in java? What are the kinds of polymorphism?
Does set allows null in java?
Can inner class have constructor?
What is compiler and what its output.
Why are arrays useful in java?
What is the public field modifier?
What are operators and its types?
What is object-oriented paradigm?
How finally used under exception handling?
What is hashtable and explain features of hashtable?
What is array in java?
What is balanced tree in java?
What does null mean in java?
What is difference between fileinputstream and filereader in java?
Can a class be defined inside an interface?