Hello all!

I am starting to write a little roulette game and while trying to print out my arrays to make sure they contain the correct values the compiler keeps screaming this at me:

"non-static method .... cannot be referenced from a static context"

Any pointers would be greatly appreciated!

// Roulette Main

import java.util.*;

class Roulette
{
	public int[] low()
	{
		int[] bet = new int[18];

		for (int i = 0; i < bet.length; i++)
		{
			bet[i] = i + 1;
		}
		System.out.println(Arrays.toString(bet));
		return bet;
	}

	public int[] high()
	{
		int[] bet = new int[17];

		for (int i = 18; i < bet.length; i++)
		{
			bet[i] = i + 1;
		}
		System.out.println(Arrays.toString(bet));
		return bet;
	}

	public int[] odd()
	{
		int[] bet = new int[36];

		for (int i = -1; i < bet.length; i++)
		{
			bet[i] = i + 2;
		}
		System.out.println(Arrays.toString(bet));
		return bet;
	}

	public int[] even()
	{
		int[] bet = new int[36];

		for (int i = 0; i < bet.length; i++)
		{
			bet[i] = i + 2;
		}
		System.out.println(Arrays.toString(bet));
		return bet;
	}
	public static void main(String[] args)
	{
		low();
		high();
		odd();
		even();
	}
}

Oops I found the issue (had to make the methods I wanted to call from main static as well).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.