In the current lesson, we take a closer look at the most frequently used Java API classes. Svetlin Nakov will explain all about the Math class, how to generate random numbers, the need of BigInteger and BigDecimal in programming, and how to work with date and time in Java. We will also look at two of the main Java classes - Arrays and Formatter.
The Math class contains methods for performing basic numeric operations, such as round, min, max, abs, ceil, etc.. The Arrays class contains various methods which facilitate array manipulation. String.format() allows us to return the formatted string by given locale, format, and arguments.
In this lesson you will find many helpful examples and exercises, so make sure to practice what you've learned! That's the only way to grasp the concept at hand.
BigInteger and BigDecimal are used for handling large and small numbers with great precision. BigInteger will throw an exception when the result is out of range. BigDecimal gives the user complete control over the rounding behavior. Importing a single package allows us to work with the date and time API.
- 1. Lesson Summary
- 2. Table of Content
- 3. YouTube Video
- 4. Lesson Topics
- 5. Resources
- 6. Practical Exercises
- 7. Navigation
In this lesson we cover the following topics:
- The Judge System
- The Exception class
- Types of exceptions and their hierarchy
- The Math Class
- The Random Class
- The Arrays Class
- Methods of the Arrays Class
- Example of Sorting an Array
- String Formatter
- BigInteger and BigDecimal
- Coding Exercises
Remember that coding is a skill, which should be practiced. To learn to code, you should write code every day for a long time. Watching tutorials is not enough. You should code!
Resources | Link |
---|---|
Lesson Video | YouTube |
Lesson Content | SoftUni |
You will get access to automated exercises which will sharpen your coding skills. Become a member of the SoftUni Global Community and communicate with other students and mentors and get help for FREE. Please watch the video and solve the exercise problems. Writing code is the only way to master the skill of coding. Submit your code at the SoftUni Judge.
Resources | Link |
---|---|
Problem Descriptions | Access the Learning Materials |
Submit Solutions for Evaluation | Access the Learning Materials |