What is casting?
Answers were Sorted based on User's Feedback
Answer / dsr
The object will be convert into another object type through
casting. This is known as cating
| Is This Answer Correct ? | 7 Yes | 0 No |
Answer / vijayakumar chinnasamy
Casting means converting values from one data type to
other data type.For example to convert the int values to
float type vlaues.
Types of casting:
1. Downcasting -source is larger than destination type
2. upcasting - Source is smaller than destination type.
casting can be applicable to both primitive type and Object
type.
primitive type - convert numeral to floating point and vice
versa.
Object type - converting from subclass to super class or
vice versa.
superClassObj = subClassObj;
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / rajashree
Casting is a mass production process which involves molten
materials (such as metals, plastics or resins) being poured
into a mold, allowed to solidify and then extracted for
use. Casting can be thought of as a method for reproducing
something - whether a mere part or a single unit by itself.
Casting is a process that can be used to manufacture
complex parts which would prove too expensive or time-
consuming to produce using other methods such as cutting or
shaping these from solid materials.
| Is This Answer Correct ? | 2 Yes | 9 No |
how to create an applet
What is the difference between super class & sub class?
can you use the two main method in same class?how?
4 Answers DELL, Geosoft, SparkTG,
What is functional interface in javatpoint?
How to change the priority of thread or how to set priority of thread?
Why string is not a wrapper class?
"we cannot create an object of interface but we can create a variable of it".diacuss the statement with the help of an example.
What are the drawbacks of singleton class?
What is inner class?what is the use of inner class?where we create the object for inner class? and inner class can extend any class or inner class can implement any interface?
How we create object in copy constructor?
Is java call by value?
Explain hashset and its features?