I'm just learning OOP in Java. I'm trying to call a constructor from another one to enter a message. Thank you for your help. Here's my code:
import java.util.Scanner;
class Sample {
private String User;
private int ID;
public Sample(String user) {
Scanner sc = new Scanner(System.in);
User = user;
ID = 0;
User = sc.nextLine();
ID = sc.nextInt();
}//CONSTRUCTOR
}//Sample
public class Sample_2 {
private Sample user1, user2, user3;
public Sample_2() {
user1 = new Sample(); //FROM HERE I WANT TO CALL THE OTHER CONSTRUCTOR ABOVE.
user2 = new Sample();
user3 = new Sample();
}//CONSTRUCTOR
public static void main(String args[]){
}//main
}//Sample_2