Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Draw a memory model for the following code: public class Point { private double x; private double y; public Point(double x_in, double y_in) { this.x

Draw a memory model for the following code:

public class Point

{

private double x;

private double y;

public Point(double x_in, double y_in)

{

this.x = x_in;

this.y = y_in;

this.y = 55;

}

public static void main( String[] args )

{

double d = 42.0;

Point p;

p = new Point(d, 42.0);

Point q = new Point(p.x, 42) p = q; p.x = q.y;

}

}

------------------------------------------------------------------

1. What does the variable p contain?

A. A value 42.0

B. A reference to a point object, which has an x value of 42, and a y value of 55.

C. A reference to a point object, which has an x value of 55, and a y value of 42;

D. A reference to q

E. None of these

--------------------------------------------------------------

2. Which memory model best reflects this code?

image text in transcribed

please help me! Thanks in advance! (java programming)

d 42.0 d 42.0 x 42 y 55.0 x 42. y 55 x 55 E. Other C. d 42.0 D. d 42.0 55 y 55

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

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

More Books

Students also viewed these Databases questions

Question

=+5 How does HRM relate to efforts to increase innovation?

Answered: 1 week ago