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: 
It doesn't work because trshIt will get its values from the fields before they are initialised in the constructor.

Initialising trshIt in the constructor after every other variable should work.

Also, as CO2TrashEmissions is constant by looks of it (and maybe myPlot too?), you should probably declare it static and final to prevent it from changing. Though it won't prevent modifications to the elements themselves.

```
private static final double[] CO2TrashEmissions = {184.0, 25.6, 46.6, 165.8};
//Fields....
boolean[] trshIt;

//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[]{myP, myPla, myGl, myCa};
}

```

Also, note that since booleans are literals, changing one of your my\* variables won't change the corresponding element in the array which may be a problem depending on what your program is doing.
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;
}

```