Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Listing will not work in Java? I am trying to create a new \"private Listing[] i

ID: 3708409 • Letter: L

Question

Listing will not work in Java?

I am trying to create a new "private Listing[] info" for my program and it will just not work...

It continues to say "cannot find symbol - class Listing"

But as you can see, it is doing it for all Listings.

Please help! I am not sure what I am doing wrong and I have been looking for hours!

My main so far, still does not recognize it.

// instance variables- replace the example below with your own private int top; private int size; private Listing] info; cannot find symbol class Listing /t * Constructor for objects of class Stack public Stack() //initialises instance variables top = -1; size - 100; info - new Listingl size]; x* k Push allows an element to be added * @param none, will add node * @return true or false, based on ability to push public boolean push (Listing newNode) // Checks if stack is not full, and pushes it if so if (isStackFull()) //lets user know stack is being overflowed

Explanation / Answer

In java there is no in-built Listing class. You have to define your own Listing class as below.

Listing.java

public class Listing {

// your instance fields and methods

}

But I suppose you want to use a List of numbers or strings.

You can use ArrayList class of java

import java.util.*;

Usage

ArrayList<Integer> list = new ArrayList<Integer>();

list.add(1)

list.add(2);

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote