Question: public class Sample { private int a; private double b; public Sample ( int x , double y ) { a = x; b =

public class Sample
{
private int a;
private double b;
public Sample(int x, double y)
{
a = x;
b = y;
}
// No other constructors
}
The following method appears in a class other than Sample.
public static void test()
{
Sample object = new /* missing constructor call */ ;
}
Which of the following could be used to replace /* missing constructor call */ so that the method will compile without error?
Responses
Sample()
Sample()
Sample(int x =10, double y =6.2)
Sample(int x =10, double y =6.2)
Sample(int x, double y)
Sample(int x, double y)
Sample(10,6.2)
Sample(10,6.2)
Sample(6.2,10)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!