import java.util.Scanner;
class NoMatchException extends Exception {
static void method() throws Exception{
String s = "India";
String s2 = " ";
try {
if (!s.equals(s2)){
throw new NoMatchException();
//System.out.println("Strings are equal");
}
else {
System.out.println("Strings are equal");
//throw new NoMatchException();
}
}
catch(NoMatchException ne){
System.out.println("Exception Found For String");
}
finally {
System.out.println("In Finally Block");
}
}
}
public class BasicException {
static void myMethod(int x, int y) throws Exception{
try {
if(x < y ) {
System.out.println("Y is greater then X");
throw new Exception();
}
else
System.out.println("Y is smaller");
}
catch(Exception ex) {
System.out.println("exception found");
//System.out.println(ex.toString());
}
finally {
System.out.println("FINALLY block");
}
}
public static void main(String args[]) throws Exception{
Scanner s = new Scanner(System.in);
int d, a, x, y;
System.out.println("Enter the value of x and y");
x = s.nextInt();
y = s.nextInt();
try {
BasicException.myMethod(x , y);
}catch(Exception e) {
System.out.println("main method exception");
System.out.println(e.toString());
}
try {
NoMatchException.method();
}
catch(NoMatchException e) {
System.out.println("Exception Caught");
}
try{
d=0;
a=42/d;
System.out.println("This will not be printed.");
}
catch(ArithmeticException e){
System.out.println("Division by zero.");
}
}
}
define the data types
program relocation is the process which modifies the object program so that it can be loaded at an address different from the location originally specified.
define program i. program means set of instruction which are required for a particular type of task is called program ii. set of instruction or commands which are given for the computer to do different activity or jobs or works is called program define programming the process of creating/modifying a program; some people's job, others' hobby
pictorial representation of a program is called a flowchart
// macro definitions: #define PI 3.14159265358979323846 #define CIRCUMFERENCE(radius) (2. * (radius) * PI) // use this as in CIRCUMFERENCE(21.34)
Symbiosis describes a relationship where two entities depend on each other.
No.
A camera
define the data types
Breaking the sequence of program
Define Financial Fitness.
program relocation is the process which modifies the object program so that it can be loaded at an address different from the location originally specified.
define program i. program means set of instruction which are required for a particular type of task is called program ii. set of instruction or commands which are given for the computer to do different activity or jobs or works is called program define programming the process of creating/modifying a program; some people's job, others' hobby
A Catch block is part of the exception handling mechanism in Java. It is used along with the try block. Ex: try { ... } catch (Exception e) { ... } The catch block is used to catch & handle the exception that gets thrown in the try block.
A video is a program, movie, or the like, that is available commercially on videocassette.
Define c-program and give an example
operating system is a control program as it allow multiple task to performed on same window.