Im пытается создать и добавить строки в списокСоздание и добавление элементов в список JAVA
package the.arraylist.pkgclass;
import java.util.ArrayList;
/**
A class to implement a Polynomial as a list of terms, where each term has
an integer coefficient and a nonnegative integer exponent
@author your name
*/
public
class Polynomial
{
// instance variable declarations go here
Term theTerm ; //initializes a term
/**
Creates a new Polynomial object with no terms
*/
public
Polynomial()
{
// TO DO: Write constructor body here
ArrayList<Term> list1 = new ArrayList<>();
}
/**
Inserts a new term into its proper place in a Polynomial
@param coeff the coefficient of the new term
@param expo the exponent of the new term
*/
public
void insert (int coeff , int expo)
{
// TO DO: write method body here.
}
Я не чувствую, что я инициировал список правильно, потому что я не могу назвать в списке в вставка класс.
Строки состоят из полиномов, которые уже являются строками.
Не знаете, что вы подразумеваете под «Строки будут состоять из полиномов, которые уже являются нитями». – Claudio