I wanted to use the util.Date
class in Java, but when I tried to instantiate a Date
object, I realized that all the constructors that I can understand--the simple ones--were gone. All deprecated.
Can anybody tell me how I can make use of Date
class?
Here is my code.
Constructor:
public Company(int id, String name, Date foundationDate) {
super();
this.id = id;
this.name = name;
this.foundationDate = foundationDate;
}
TestClass:
Company[] companies = new Company[3];
companies[0] = new Company(1, "Sabanci", new Date(12,12,12));