Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

what is the output of this code? 54 - class main_class{ 55 public static void main (String[Jargs) { 56 ShockAbsorber sa = new ShockAbsorber(0.5,5.5,0.8); ;

what is the output of this

image text in transcribed

code?

image text in transcribed

54 - class main_class{ 55 public static void main (String[Jargs) { 56 ShockAbsorber sa = new ShockAbsorber(0.5,5.5,0.8); ; System.out.println("Shock Absorber details'); 58 System.out.println(sa) 59 57 60 } 61 ute public class ShockAbsorber{ double pistonRodLength: double springTension; double cylinderLength; public ShockAbsorber() { pistonRodLength = 0; spring Tension = @ cylinderLength = 0; public ShockAbsorber (double pistonRodLength, double springTnsion, double cylinderLength) { this.pistonRodLength = pistonRodLength; this.spring Tension = springTension; this.cylinder Length = cylinderLength; B 0 public void setPistonRodLength(double d) { pistonRodLength = d; } public void setSpringTension(double d){ spring Tension = d; } public void setCylinderLength(double d) { cylinderLength =d; } 22 23 24- 25 26 27 28 29 - 30 31 32 33 34 35 36 - 37 38 39 - 40 41 42 43 44 45 46 47 48 49 50 51 52 public double getPistonLength() { return pistonRodLength; } public double getSpringTension() { return springTension; } public double getcylinderLength(){ return cylinderLength: } public String toString) (){ String S= 'Piston Rod Length = ' + pistonRodLength + 'mm'; 5 +=' Spring Tension =' + springTension + 'N'; 5 + ' cylinder Length Tension=' + cylinderLength + 'mm' return 5; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts Of Database Management

Authors: Joy L. Starks, Philip J. Pratt, Mary Z. Last

9th Edition

1337093424, 978-1337093422

More Books

Students also viewed these Databases questions

Question

LO2 Compare three types of individual incentives.

Answered: 1 week ago