Control flow in try catch finally exception handling in java by Ponnam Jay | exceptions in java

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 ต.ค. 2024
  • In this video; I explained about try catch finally blocks flow exception handling in java.
    Disclaimer- Some contents are used for educational purpose under fair use. Copyright Disclaimer Under Section 107 of the Copyright Act 1976, allowance is made for "fair use" for purposes such as criticism, comment, news reporting, teaching, scholarship, and research. Fair use is a use permitted by copyright statute that might otherwise be infringing. Non-profit, educational or personal use tips the balance in favor of fair use.
    ----------------------------------------------------------------------------------------------------------------------
    Copyright Notice:-
    Please feel free to leave me a notice to::::: pnmjay3@gmail.com :::::: if You find this upload inappropriate.
    Contact me personally if You are against an upload which You may have rights to the Images (or) music,
    instead of contacting TH-cam about a Copyright Infringement....Thank You..!"
    -------------------------------------
    Task:
    what is the out put for this program ?
    // Program Begins...
    public class ExceptionFlow {
    public static void main(String[] args) {
    try {
    System.out.println("ARNICA MONTANA");
    System.out.println("BELLIS PERENNIS");
    System.out.println("CALENDULA OFFICINALIS"+1/0);
    System.out.println("DULCAMARA");
    } catch (ArithmeticException e) {
    System.out.println("Eupatorium Perfoliatum");
    System.out.println("Ferrum Phosphoricum"+1/0);
    } finally {
    System.out.println("HOMEOPATHIC MATERIA MEDICA by James Tyler Kent, M.D");
    System.out.println("HOMEOPATHIC MATERIA MEDICA by William BOERICKE, M.D");
    System.out.println("HOMEOPATHIC MATERIA MEDICA by John Henry CLARKE, M.D");
    }
    System.out.println("Organon Of Medicine by BK Sarkar");
    }
    }
    // Program End.
    Option 1:
    ARNICA MONTANA
    BELLIS PERENNIS
    Eupatorium Perfoliatum
    HOMEOPATHIC MATERIA MEDICA by James Tyler Kent, M.D
    HOMEOPATHIC MATERIA MEDICA by William BOERICKE, M.D
    HOMEOPATHIC MATERIA MEDICA by John Henry CLARKE, M.D
    Exception in thread "main" java.lang.ArithmeticException: / by zero
    at com.blogspot.javacodebypj.ExceptionFlow.main(ExceptionFlow.java:19)
    Option 2:
    ARNICA MONTANA
    BELLIS PERENNIS
    Eupatorium Perfoliatum
    HOMEOPATHIC MATERIA MEDICA by James Tyler Kent, M.D
    HOMEOPATHIC MATERIA MEDICA by William BOERICKE, M.D
    Option 3:
    ARNICA MONTANA
    BELLIS PERENNIS
    Eupatorium Perfoliatum
    HOMEOPATHIC MATERIA MEDICA by James Tyler Kent, M.D
    HOMEOPATHIC MATERIA MEDICA by William BOERICKE, M.D
    HOMEOPATHIC MATERIA MEDICA by John Henry CLARKE, M.D
    Exception in thread "main" java.lang.ArithmeticException: / by zero
    at com.blogspot.javacodebypj.ExceptionFlow.main(ExceptionFlow.java:13)
    Option 4:
    Compile time error.
    Answer comment it in the comment section.

ความคิดเห็น •