Learn Java Basics
About Lesson

Java Standard Library (also known as Java API) is a collection of classes, interfaces, and packages that come bundled with the Java Development Kit (JDK). The library provides many built-in methods that you can use in your Java programs without having to write the code from scratch. Here are some of the commonly used methods in the Java Standard Library:

  1. String methods: The String class in Java provides many useful methods for manipulating strings. Some of the commonly used methods include length(), charAt(), substring(), indexOf(), equals(), equalsIgnoreCase(), toLowerCase(), toUpperCase(), trim(), replace(), etc.

  2. Math methods: The Math class in Java provides many mathematical functions such as sqrt(), abs(), ceil(), floor(), pow(), max(), min(), random(), etc.

  3. Date and Time methods: The java.time package in Java provides classes for working with dates and times. Some of the commonly used classes include LocalDate, LocalTime, LocalDateTime, ZonedDateTime, Duration, Period, etc.

  4. Collection methods: The Java Standard Library provides many classes for working with collections such as List, Set, Map, Queue, etc. Some of the commonly used methods include add(), remove(), size(), contains(), get(), put(), isEmpty(), etc.

  5. File and IO methods: The Java Standard Library provides classes for working with files and input/output operations. Some of the commonly used classes include File, InputStream, OutputStream, Reader, Writer, BufferedReader, BufferedWriter, etc.

  6. Networking methods: The Java Standard Library provides classes for working with networking such as Socket, ServerSocket, InetAddress, URL, URLConnection, etc.

Join the conversation