You are on page 1of 6

[2:50 PM] Geethanjali Anbalagan(External Trainer) (Guest)

package com.java.array;
import java.util.*;
public class BasicArray {
public static void main(String[] args) {
int[] age = new int[50];
Scanner sc = new Scanner(System.in);
System.out.println("Enter no values");
int x = sc.nextInt();
System.out.println("values are");

for(int i=0;i < x;i++) {

age[i]=sc.nextInt();
}
for(int i=0;i < x;i++) {

System.out.println(age[i]);
}

}
/*
i=0;i<age.length;i++

i=0 i<3 age[0] 4 i++


i=1 1<3 age[1] 7 i++ 2
i=2 2<3 age[2] 8 i++ 3
i=3 3<3 */

[2:50 PM] Geethanjali Anbalagan(External Trainer) (Guest)

package com.java.array;
import java.util.*;
public class BasicArray {
public static void main(String[] args) {
int[] age = new int[50];
Scanner sc = new Scanner(System.in);
System.out.println("Enter no values");
int x = sc.nextInt();
System.out.println("values are");

for(int i=0;i < x;i++) {

age[i]=sc.nextInt();
}
for(int i=0;i < x;i++) {

System.out.println(age[i]);
}

}
}
/*
i=0;i<age.length;i++

i=0 i<3 age[0] 4 i++


i=1 1<3 age[1] 7 i++ 2
i=2 2<3 age[2] 8 i++ 3
i=3 3<3 */

[2:50 PM] Geethanjali Anbalagan(External Trainer) (Guest)

package com.java.array;
import java.util.*;
public class BasicArray {
public static void main(String[] args) {
int[] age = new int[50];
Scanner sc = new Scanner(System.in);
System.out.println("Enter no values");
int x = sc.nextInt();
System.out.println("values are");

for(int i=0;i < x;i++) {

age[i]=sc.nextInt();
}
for(int i=0;i < x;i++) {

System.out.println(age[i]);
}

}
/*
i=0;i<age.length;i++

i=0 i<3 age[0] 4 i++


i=1 1<3 age[1] 7 i++ 2
i=2 2<3 age[2] 8 i++ 3
i=3 3<3 */

public class TryCatchExample6 {

public static void main(String[] args) {


int i=50;
int j=0;
int data;
try
{
data=i/j; //may throw exception 50/0
System.out.println(data);
}
// handling the exception
catch(Exception e)
{
// resolving the exception in catch block
System.out.println(i/(j+2));//50/2
//System.out.println(e);
}
System.out.println("rest of the code");
System.out.println("rest of the code");
}
}

package Exceptionhandling;

//to handle another unchecked exception.

public class TryCatchExample9 {

public static void main(String[] args)


{
try {
String input = "Geethanjali";
System.out.println("Input is:" + input);
int output = Integer.parseInt(input);
System.out.println("Output is:" + output);
System.out.println("remaining part of code");
} catch (ArrayIndexOutOfBoundsException e) {
System.out.println("Input is required");
}catch(NumberFormatException e){
System.out.println(e);
System.out.println("Invalid input provided");
}finally{
System.out.println("Finally try block executed");
}
System.out.println("More code can go here");
System.out.println("rest of the code");
System.out.println("rest of the code");
}

}package Exceptionhandling;

//to handle another unchecked exception.


public class TryCatchExample9 {

public static void main(String[] args)


{
try {
String input = "Geethanjali";
System.out.println("Input is:" + input);
int output = Integer.parseInt(input);
System.out.println("Output is:" + output);
System.out.println("remaining part of code");
} catch (ArrayIndexOutOfBoundsException e) {
System.out.println("Input is required");
}catch(NumberFormatException e){
System.out.println(e);
System.out.println("Invalid input provided");
}finally{
System.out.println("Finally try block executed");
}
System.out.println("More code can go here");
System.out.println("rest of the code");
System.out.println("rest of the code");
}

package Exceptionhandling;

import java.io.*;
class M{
void method()throws IOException{
System.out.println("Hi");
throw new IOException("device error");
}
}
public class Testthrows2{
public static void main(String args[]){
try{
M m=new M();
m.method();
}catch(Exception e)
{
System.out.println(e);
System.out.println("exception handled");}

System.out.println("normal flow...");
}
}

ebox:
package Exceptionhandling;
import java.util.*;

class WeightLimitExceeded extends Exception{


WeightLimitExceeded(int x){
System.out.print(Math.abs(15-x)+" kg : ");
System.out.println("Weight exceeds");
}
}

public class CustomException {


void validWeight(int weight) throws WeightLimitExceeded{
if(weight>15)
throw new WeightLimitExceeded(weight);
else
System.out.println("You are ready to fly!");
}

public static void main (String[] args) {


CustomException ob=new CustomException();
Scanner in=new Scanner(System.in);
for(int i=0;i<2;i++){
try{
ob.validWeight(in.nextInt());
}catch(WeightLimitExceeded e){
System.out.println(e);
}
}

Introduction
[
(reason of writing the email)

This is with regards to your requirement of a software application for your


business.

This is with reference to our meeting/telephonic conversation with regards to


the software application you require for your business.

I sincerely apologise for the delay in the development of the application.

I assure you that the project will be completed by 7th March 2022.

I sincerely apologise for the delay in the development of the application. The
project completion is delayed due to unexpected circumstances.

I assure you that the project will be completed by 7th March 2022.
Please do not hesitate to get in touch with me in case you have any further
questions.

I thank you for your understanding and patience.

You might also like