All the submethods, m1, m2... have return type as void.
Now, according to this try-catch block, here if any exception occurs in any of the methods, the rest of the methods should not execute.
How do I set the error Message and print exactly

You could increase some counter after each method execution, and determine by it's value which method failed.

You could use an error flag (set initialy to false), and each method will be executed in it's own try ... catch and depend of the error flag beeing false. When an error ocurs, set the error flag to true -> will cause all subsequent functions to not beeing executed.

0

Featured Post

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Introduction
This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …

Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop.
Define While Loop:
Basic Example:
Explanatio…

Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program.
Download Eclipse installation zip file:
Extract files from zip file:
Download and install JDK 8:
Open Eclipse and …