Tuesday 17 September 2019

Write a Program for exception Handling in java

                                          Program for Exception Handling in Java using try and catch blocks


1. Open the notepad file.

2. Write the code given below in the file.


import java.util.Scanner;
class Excep
{
public static void main(String args[])
{

int div,a,b;
Scanner input= new Scanner(System.in);
System.out.println("Enter 1st Number");
a=input.nextInt();
System.out.println("Enter 2nd Number");
b=input.nextInt();
try
{
div=a/b;

Monday 16 September 2019

Socket Programming in java

                                    Creating Chat Server in Java 

1. Open two notepad files.
2. Write the codes of Server and Client in separate files.

a.) Server Code
import java.io.*;
import java.net.*;
public class MyServerCode
{DataInputStream dIS;
public MyServerCode()
{
try
{

Simple Program for creating object in JAVA.

                        Java Program for Object Creation



1. Open notepad file.
2. Write the code given below in notepad.

class Student
{
String name;
String age;
public static void main(String arg[])
{//Creating Object of Student class
Student  obj= new Student(); // calling default constructor while creating object
System.out.println("Default Name of Object "+obj.name);
System.out.println("Default Age of Object "+obj.age);
}

}


DBMS NOTES UNIT 3

                                                              UNIT 3  ER (Entity Relationship) An entity-relationship model is known as an E...