Q:

Creating an object to record a users Score

I am creating a quiz type console application which records the score of the user depending on the answer is correct or incorrect. I am wondering (because of multiple categories) would it be a better idea to create a score class instead of having it in the methods individually. If so, what would be the best way of implementing this. External resources also greatly welcomed
Current the code is as follows
import java.util.Scanner;

public class DummyQuiz {
    static Scanner input = new Scanner(System.in);
    static int score = 0;

    public static void category1()
    {
        int answer1;
        System.out.println("Question 1");
        System.out.println("1) answer 1");
        System.out.println("2) answer 2");
        answer1 = input.nextInt();

        if(answer1 == 1)
        {
            System.out.println("Correct!\n");
            score++;
        }
        else
        {
            System.out.println("Incorrect\n");
        }                     
    }//category1

    public static void main(String []args){

        category1();
        // Output final score here

    }
}

A:

I would urge you to clean up your Question into Object(s) first. Note that the Question should be responsible for determining if the answer is correct. You create a collection (or array) of Question(s), print them (which calls toString), test for correct by calling isAnswerCorrect and I think you'll find scoring is then easy (by testing your questions collection/array size you know how many total will be asked at the start):
public class Question {
  private String question;
  private int answer = 1;

  public Question(String question, int answer) {
    this.question = question;
    if (answer > 0) {
      this.answer = answer;
    } else {
      System.err.println("0 is no answer (e.g. not a value)");
    }
  }

  public boolean isAnswerCorrect(Integer answer) {
    return this.answer == (int) answer;
  }

  public int getCorrectAnswer() {
    return answer;
  }

  public String toString() {
    return question;
  }
}

