Question: I'm currently reading Peter Norvig's Artificial Intelligence a Modern Approach (AIMA) to learn the basics of AI (I chose this book after reading about it on the internet and asking a professor of mine if it was a good place to start. 

I'm currently at Chapter 7 (first chapter of part 3 - Knowledge and Reasoning) part 4 is Uncertain Knowledge and Reasoning and Part V is about learning (what is the part I'm most interested in right now)

From anyone who's ever used this book as a source of study I'd like to know if I could read part 5 (to start learning what is my current goal) in parallel with parts 3 and 4 (I want to read all the chapters in the book, cause I think it'll just add up to my knowledge base). Can I do this? Will I be "wasting more time" than gaining ? 

Thanks in advance. PS: my current goal really is machine learning and that's why I'm insecure, I' don't know if it's worth reading the "learning" part before the knowledge part

Answer: 
Declare `trshIt` as a member of the class, but initialize it in the constructor, like this:

```
boolean [] trshIt;
double [] CO2TrashEmissions = {184.0, 25.6, 46.6, 165.8};

//constructor
CO2FromWaste(int crust, boolean p, boolean pl, boolean gl, boolean ca)
{
    myPlot = 1018.0;
    myCrust = crust;
    myP = p;
    myPl = pl;
    myGl = gl;
    myCa = ca;

    trshIt = new boolean[4];
    trshIt[0] = myP;
    trshIt[1] = myPla;
    trshIt[2] = myGl;
    trshIt[3] = myCa;
}

```
Any reason you can't do this:

```
//private variables
boolean myP;
boolean myPla;
boolean myGl;
boolean myCa;

double myPlot;
int myCrust;

double myReduct;
double myNet;
double myGross;

boolean [] trshIt;
double [] CO2TrashEmissions;

//constructor
CO2FromWaste(int crust, boolean p, boolean pl, boolean gl, boolean ca){

    myPlot = 1018.0;
    myCrust = crust;
    myP = p;
    myPl = pl;
    myGl = gl;
    myCa = ca;
    trshIt = new boolean[4];
    trshIt[0] = myP; trshIt[1] = myPla;
    trshIt[2] = myGl; trshIt[3] = myCa;

    double [] CO2TrashEmissions = {184.0, 25.6, 46.6, 165.8};
}

```

In Java, primitives (int, char, boolean) are assigned by value, so if you do

```
boolean b = true;
boolean[] a = { b };
b = false;

System.out.println( ( a[0] == true ) ? "true" : "false" );

```

will print "true" because `b = false;` doesn't change the value in the `a` array (because it doesn't store the "pointer" to `b`, but the value that was in `b`.