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 function and its uses?
What is the Concept of Encapsulation in OOPS
What is meant by 'bit masking' in java?
What is the use of predicate in java 8?
What are thread groups?
Is it possible to compare various strings with the help of == operator?
What is classname class in java?
Why does java have two ways to create child threads? Which way is better?
What is the latest version of java?
What is preparedstatement in java?
What is java and why do we need it? Explain
Can java arraylist hold different types?
Is java written in c?
What is a lightweight component?
What function extracts specified characters from a string?