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
Can java run on google chrome?
List some important characteristics on jre
How does queue work in java?
What is downcasting?
Why for each loop is used?
Hi all, I am dng a mini project on FileSplitter application which splits the GBs of logfile into Smaller chunks(mbs) depending on the split size." How to handle GBs file? I am getting OutOfMemoryException, when I input such GB sized file. Thx
Name few java.lang classes introduced with java 8 ?
What is binary search in java?
What are structs in java?
What is the purpose of encapsulation?
What does s mean in regex?
What is string immutability?
What is immutable data?
What is difference between final and finally in java?
How do you declare an array in java?