I am following the example of a book in Java. Using the example:
StringBuilder str = new StringBuilder();
str.append (" We sold ");
I am using Eclipse and the JDK 10 oracle and for some reason, the append method is not popping up, it is not there using Eclipse. I have the same problem by adding: import java.lang.*; but that did not work. Also, StringBuilder is an important class that I cannot afford to skip.
I have also tried to fix the problem by adding: import java.lang.*; but that did not solve the issue. The compiler gives me the option of creating an append method or adding cast to append which does not work.
public static void main(String[] args) {
StringBuilder str = new StringBuilder();
str.append(" Joe");
}
This is my full code:
import java.lang.*;
public class StringBuilder
{
public static void main(String[] args)
{
StringBuilder str = new StringBuilder();
str.append(" Joe");
}