image
Throw vs. Throws
Start course
Difficulty
Beginner
Duration
30m
Students
22
Ratings
5/5
Description

In this course, we will learn the concepts of microservice and spring framework and focus on Exception Handling.

Learning Objectives

  • Exception Handling in Java 

Intended Audience

  • Beginner Java developers
  • Java developers interested in learning how to Build and Deploy RESTful Web Services
  • Java Developers who want to develop web applications using the Spring framework
  • Java Developers who want to develop web applications with microservices
  • Java Developers who wish to develop Spring Boot Microservices with Spring Cloud

Prerequisites

  • Basic Java knowledge
Transcript

Hello there, my friend. In the previous videos we learned the throw and throws keywords. In this video, we will look at the differences between the throw and throws keyword. Let's compare the throw and throws keywords by using a table to understand better. The throw keyword is used to explicitly throw an exception. Throws keyword is used to declare an exception. The throw is followed by an instance. Throws is followed by class. The throw is used within the method, throws is used with the method signature. We can declare only one exception with throw at a time. We can declare multiple exceptions with throws at a time. So, those are the main differences between the keywords throw and throws. I think you got it. Let's take a short break here and I'll see you in the next lesson ,friends.

 

About the Author
Students
3918
Courses
64
Learning Paths
5

OAK Academy is made up of tech experts who have been in the sector for years and years and are deeply rooted in the tech world. They specialize in critical areas like cybersecurity, coding, IT, game development, app monetization, and mobile development.