0

Using the Eclipse IDE with jdk-13.0.2 and JavaSE-13, Windows 10 Business on a Dell laptop.

I'm trying to make an array of char arrays for a class project. We can't use Strings, which is why I am trying to make this work.

private final int stackSize = 100;
private int top;
private char[] items;
private char[] inside;

public CharArrayStack() {
items = new char[stackSize];
char[] items = {char[] inside, };
top = -1;

Above is what I have, but I'm getting a, "The target type of this expression must be a functional interface" error.

Jacob L.
  • 57
  • 5

1 Answers1

0

Maybe a two-dimensional array will work for you.

char[][] items = new char[][];

You can initialize it in different ways:

char[][] items = {
      {'a', 'b', 'c'}, 
      {'a', 'b', 'c'}, 
      {'a'}, 
};
John
  • 770
  • 1
  • 9
  • 18