Skip to main content

Posts

Showing posts from February 24, 2019

How can you create our own Exception

How can you create our own Exception? •       ->If you are creating our own Exception that is known as custom exception or user-defined exception. •       -> Java custom exceptions are used to customize the exception according to user need. •       -> By the help of custom exception, we can have our own exception and message. Let's see a simple example of java custom exception. •       package com.technology4nextvision; •       class technology4nextvision extends RuntimeException •       { •                 private static final long serialVersionUID = 1L; •                 technology4nextvision(String s) •                 { •                          super(s); •                 } •       } •       class technology4nextvisionTest •       { •                 public static void main(String args[]) •                 { •                          String s="technology4nextvision"; •                          •