Essentially, I am making a small program that deals with double values and enums as inputs and returns some output. The problem is that I need to make a new object as such:
For this problem I am unable to import classes or use static methods, so I have been trying to clone the two objects without any imported classes. I'm unsure if my "Example z = new Example(t)" line is false or what. I can set the values of 't' to another set private 'Example' object, but I don't know how to send that information to the object 'z'.
public class Example{
private double temp;
private Scale scale;
private char start;
public Example(double temp){...}
public Example(double temp, Scale scale){...}
public Example(Example input){
/*I don't know what to put in here in order
in order to copy the input to a new object*/
}
}
public class Test{
public static void main(String[] args){
Example t = new Example(-10000.1, Scale.FAHRENHEIT);
Example z = new Example(t);
}