A Library of Classes


Collapse Content

One of the big benefits of Object-Oriented Programming is how easy it becomes to re-use code. You can create a class for use in one project and then later easily use it in another project. You can use classes created by other people without even knowing how they work internally.

The Java programming language comes with a very large set of classes known as the Java Class Library. These classes provide a wide range of functionality for doing many common programming tasks. Each class in the Library can be used in your own projects just as you would use your own classes. You can create instances of the class and then invoke its methods.

The Java Library is organized into sub-libraries known as packages. Each package can contain hundreds of classes. In order to use a class in the Library, you (usually) need to import it to your project, which you'll see how to do later.

Challenge

The Java Library includes a Class known as StringBuilder. It has a constructor that takes no parameters (you don't need to worry about other details). In one line of code, declare and create a new StringBuilder instance named bigString.

Please sign in or sign up to submit answers.

Alternatively, you can try out Learneroo before signing up.

Contact Us
Sign in or email us at [email protected]