Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

public class Circle { private int raduis; private int first; private static int M=0; Find output: public Circle () { raduis=1; first=2; M+=raduis;} public

 public class Circle { private int raduis; private int first; private static int M=0; Find output: public  

public class Circle { private int raduis; private int first; private static int M=0; Find output: public Circle () { raduis=1; first=2; M+=raduis;} public Circle (int r) 1 raduis =r; first-r+2; M+=raduis; } public void setData (int r) (raduis=r; M+=raduis;} public int getRaduis() (return(raduis);} public int getfirst() (return first;} public int getFirst(int m) (return (first+raduisim);} public static int getM() (return M;); } public class circle Demo { public static void main(String[] args) { } } Circle one= new Circle(); one.setData(3); int x =one.getfirst(); Circle two new Circle (x); System.out.println(one.getM());

Step by Step Solution

3.52 Rating (159 Votes )

There are 3 Steps involved in it

Step: 1

It will print 6Lets understand step by step each line step 1 we are creating new object and calling ... 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

Java How To Program Late Objects Version

Authors: Paul Deitel, Deitel & Associates

8th Edition

0136123716, 9780136123712

More Books

Students also viewed these Programming questions

Question

Demonstrate that you cant place an import statement in a class.

Answered: 1 week ago