Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hello just want to understand what is the meaning of the code that i have highlighted, like why ThreeD sh = (ThreeD) ss; has to
Hello just want to understand what is the meaning of the code that i have highlighted, like why ThreeD sh = (ThreeD) ss;
has to be in "(ThreeD)", like what is the code looking out for? Is there any other possible way i can code it? and also what does "(Shape ss)" mean exactly. Thank you!
//prints some detials of 3d object private static void process 3DShape (Shape ss) { ThreeD sh = (ThreeD) ss; String type =""; if(sh.toString().contains("Cube")) { } type = "Cube"; } else if(sh.toString().contains("Sphere")) { type = "Sphere"; } else { } type = "Tetrahedron"; System.out.println("I am a "+type+" shape"); System.out.println("-- .");
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started