may i know why is there .toString() when you can use (String) instead? and vice versa and also for numbers can use the wrapper class’s so why do we need to have a (double)? etc
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Type Casting , Wrapper classes and toString() are completely different.
Basically the Type Casting is the process where you will change your one entity into the other entity with different datatype. Means you will simply change the datatype of the entity.
Wrapper classes are used to create an object of type from existing type object.
.toString() is method defined in Object, this method is basically used to represent your object in String format. You can override this method to represent your object in any string format.