More efficient if else block statements
<p>I'm trying to recreate a printer in java,I'm fairly new to programming so I'm using huge if else blocks inside a single function to dictate the logic of the program, I'm noticing this is creating a mass of code inside the same function, I was wondering if there was a more eloquent/efficient way of doing this, printer class below. Logic for the printer isn't too important, but just to show anyway, one is a double sided printer one isn't, and logic is in charge of checking toner levels and making sure pages printed are in line with printer being double sided or not.</p>

<pre><code>package com.company;


public class Printer {
private String name;
private double tonerLevel = 100;
private int ammountOfPaper;
private int numberOfPagesPrinted;
private boolean isDoubleSided;

public Printer(String name, double tonerLevel, int ammountOfPaper, boolean isDoubleSided) {
    this.name = name;
    if(tonerLevel &gt;= 0 &amp;&amp; tonerLevel &lt;= 100) {
        this.tonerLevel = tonerLevel;
    }
    this.ammountOfPaper = ammountOfPaper;
    this.isDoubleSided = isDoubleSided;
}

private boolean isOutOfToner(double numberToPrint) {
    if((tonerLevel - (numberToPrint / 2) &lt; 0)) {
        return true;
    }
    else {
        return false;
    }
}


private boolean isOutOfPaper(double numberToPrint) {
    if(((ammountOfPaper - numberToPrint) &lt; 0)) {
        return true;
    }
    else {
        return false;
    }
}

private boolean twoSideNoPaperEven(double numberToPrint) {
    if((ammountOfPaper - ((int) numberToPrint / 2)) &lt; 0 ) {
        return true;
    }
    else {
        return false;
    }
}

private boolean twoSideNoPaperOdd(double numberToPrint) {
    if(((ammountOfPaper - ((int) numberToPrint / 2)) - 1) &lt; 0) {
        return true;
    }
    else {
        return false;
    }
}

public void printPages(double numberToPrint) {

    if(isDoubleSided == false) {
        if(tonerLevel == 0) {
            System.out.println("Out of toner");
        }
        if(ammountOfPaper == 0) {
            System.out.println("Out of Paper");
        }
        if(isOutOfToner(numberToPrint) &amp;&amp; (tonerLevel != 0)) {
            double difference = tonerLevel * 2;
            numberToPrint = difference;
            ammountOfPaper -= numberToPrint;
            System.out.println("Will run out of toner after this print, able to print " + (int) numberToPrint +
                    " pages");
            tonerLevel = 0;
        }
        if(isOutOfPaper(numberToPrint) &amp;&amp; (ammountOfPaper != 0)) {
            double different = ammountOfPaper - numberToPrint;
            numberToPrint = numberToPrint + different;
            System.out.println("Will run out of paper after this print, printing " + (int) numberToPrint + " pages");
            ammountOfPaper = 0;
        }
        else if(!isOutOfToner(numberToPrint) &amp;&amp; (!isOutOfPaper(numberToPrint))) {
            ammountOfPaper -= numberToPrint;
            tonerLevel = tonerLevel - (numberToPrint / 2);
            showPages(numberToPrint);
        }

    }
    else if(isDoubleSided = true) {
            if (numberToPrint % 2 == 0) {
                if(tonerLevel == 0) {
                    System.out.println("Out of Toner");
                }
                if(ammountOfPaper == 0) {
                    System.out.println("Out of Paper");
                }
                if(twoSideNoPaperEven(numberToPrint) &amp;&amp; (ammountOfPaper != 0)) {
                    ammountOfPaper -= numberToPrint / 2;
                    System.out.println("There is no Paper");
                }
                else if(!twoSideNoPaperEven(numberToPrint)) {
                    tonerLevel = tonerLevel - (numberToPrint / 2);
                    ammountOfPaper -= numberToPrint / 2;
                    showPages(numberToPrint);
                }
            } else {
                if(tonerLevel == 0) {
                    System.out.println("Out of Toner");
                }
                if(ammountOfPaper == 0) {
                    System.out.println("Out of Paper");
                }
                if(twoSideNoPaperOdd(numberToPrint) &amp;&amp; (ammountOfPaper != 0)) {
                    System.out.println("There is no paper");
                    ammountOfPaper = (ammountOfPaper - ((int) numberToPrint / 2)) - 1;
                    ammountOfPaper = 0;
                }
                else if(!twoSideNoPaperOdd(numberToPrint)) {
                    tonerLevel = tonerLevel - (numberToPrint / 2);
                    ammountOfPaper = (ammountOfPaper - ((int) numberToPrint / 2)) - 1;
                    showPages(numberToPrint);
                }
            }
        }

    }

public void showPages(double numberToPrint) {
    System.out.println("Printing " + (int) numberToPrint + " Pages, paper remaining is: " + this.ammountOfPaper
            + " Toner level is: " + this.tonerLevel);
}

public void refillToner() {
    tonerLevel = 100;
}
public void refillPaper(int paper) {
    if(paper &gt; 50) {
        System.out.println("Cannot put in more paper");
    }
    else {
        this.ammountOfPaper += paper;
    }
}

public int getAmmountOfPaper() {
    return ammountOfPaper;
}

public double getTonerLevel() {
    return tonerLevel;
}

public void setTonerLevel(double tonerLevel) {
    this.tonerLevel = tonerLevel;
}

public void setAmmountOfPaper(int ammountOfPaper) {
    this.ammountOfPaper = ammountOfPaper;
}
</code></pre>

<p>Changing the If Statements To as suggested by nicolas:</p>

<pre><code> public void printPages(double numberToPrint) {
 if(tonerLevel == 0) {
        System.out.println("Out of toner");
        return;
    }
    if(ammountOfPaper == 0) {
        System.out.println("Out of Paper");
        return;
    }

if(isDoubleSided == false) {
</code></pre>