You can't call bp.add();
in class level. Instructions should be invoked in code blocks like methods, constructors or initialization blocks (where for instance you will be able to handle potential exceptions, if method would be declared to throw them).
Also you need to add something like add(whatever)
(there is no no-arbument method add
in LinkedList).
Other thing is that you should specify type of elements your list should contain by using generics. More info at What is a raw type and why shouldn't we use it?
Last thing is that if you are not going to use any method which exists only in LinkedList, you should make your code more flexible by using as reference more general (or even abstract) classes or interfaces. More info at What does it mean to "program to an interface"?
So try with
public class Mochila {
List<String> bp = new LinkedList<>();
{// this initialization block will be added at start of each constructor
// of your Mochila class
bp.add("something");
}
}