Meet Patel

I am a passionate programmer, blogger, and developer by choice. I like to write and contribute to the developer community.

Understanding Type Casting in Java : Free Java Tutorials

Through typecasting, we are not creating any new object in Java. But we are just providing another type of reference variable to the existing object. That is, we are performing typecasting and not object casting. String str = new String(“Meet”); Object obj = (Object)str; This is essentially same as defining String object with an Object …

Understanding Type Casting in Java : Free Java Tutorials Read More »

Object Type Casting in Java : Free Java Tutorials

Object Type Casting in Java says that one object reference can be typecast into another object reference. We can use parent reference to hold child object. For example, Object class reference can hold String class object. Object str = new String(); We can also use interface reference to hold implemented class object. Runnable thread = …

Object Type Casting in Java : Free Java Tutorials Read More »