1. what is the output of following program:
- package com.instanceofjavaforus;
- public class Demo{
- public static void main(String[] args) {
- try{
- System.out.println("instance of java");
- }
- }
- }
2. what is the output of following program:
- package com.instanceofjavaforus;
- public class Demo{
- public static void main(String[] args) {
- try{
- System.out.println("try block");
- }
- finally{
- System.out.println("finally block");
- }
- }
- }
3. what is the output of following program:
- package com.instanceofjavaforus;
- public class StringDemo{
- public static void main(String[] args) {
- try {
- int a = 0;
- int b = 10;
- int c = b / a;
- System.out.print("try block");
- }
- catch(Exception e) {
- System.out.print("catch block");
- }
- }
- }
No comments