I'm new to OOP and I was wondering how to set something that is not like int, string, double etc.
I have two classes, Foo and Bar, and some instance variables How can I set the Bar type instance variables?
public class Foo
{
//instance variables
private String name;
Bar test1, test2;
//default constructor
public Foo()
{
name = "";
//how would I set test1 and test 2?
}
}
public class Bar
{
private String nameTest;
//constructors
public Bar()
{
nameTest = "";
}
}