Calculating length

Report a typo

Enter the value of the currentLength variable after the following code is executed:

StringBuilder firstBuilder = new StringBuilder("Java");

firstBuilder
    .append("J")
    .append("a")
    .append("v")
    .append("a");

firstBuilder.deleteCharAt(0);

StringBuilder secondBuilder = new StringBuilder(firstBuilder);
secondBuilder.append(firstBuilder);

int currentLength = secondBuilder.length();
Enter a number
___

Create a free account to access the full topic