Program to demonstrate DataInputStream class Using Conditional Operator

/* Program to demonstrate DataInputStream class Using Conditional Operator */ import java.io.DataInputStream;   // to load DataInputStream class class P22B {        public static void main(String args[])    ...
READ MORE - Program to demonstrate DataInputStream class Using Conditional Operator

Program to demonstrate System.out.write()

/* Program to demonstrate System.out.write() */ class WriteDemo {     public static void main(String args[ ])     {         int i; char c ; float f;double d;        ...
READ MORE - Program to demonstrate System.out.write()

Program to demonstrate Wrapper Class Methods

/* Program to demonstrate Wrapper Class Methods */ import java.io.*; class WrapperClassDemo {         public static void main(String args[])     {         // Converting number...
READ MORE - Program to demonstrate Wrapper Class Methods

Program to demonstrates various Vector Operation

/* Program to demonstrates various Vector Operation */ import java.util.*; class VectorDemo {     public static void main(String args[ ])     {         // initial size is 4, increment is 2    ...
READ MORE - Program to demonstrates various Vector Operation

Program to print two-dimensional Square Root Table

/* Program to print two-dimensional Square Root Table */ import java.text.*;    // to include DecimalFormat class class TwoDArray5 {     public static void main(String args[])     {        ...
READ MORE - Program to print two-dimensional Square Root Table

Program for Matrix Multiplication

/*  Program for Matrix Multiplication */ class TwoDArray4 {     public static void main(String args[ ])     {         int i,j,k;         int multi[][]= new...
READ MORE - Program for Matrix Multiplication

Program for Matrix Addition

/*  Program for Matrix Addition */ class TwoDArray3 {     public static void main(String args[ ])     {         int i , j;         int add[][]= new int[3][3];    ...
READ MORE - Program for Matrix Addition

Program that display average of marks for each subject

/*  Program that display average of marks for each subject*/ class TwoDArray2 {     public static void main(String args[ ])     {         int i , j ;        ...
READ MORE - Program that display average of marks for each subject

Program that adds up the individual elements of 2 D Array

/*  Program that adds up the individual elements of 2 D Array*/     class TwoDArray1 {     public static void main(String args[ ])     {          int i , j , sum ;    ...
READ MORE - Program that adds up the individual elements of 2 D Array

Program to demonstrates the - trim( )

/* Program to demonstrates the - trim( ) */ class trimDemo {     public static void main(String args[ ])     {         String s1 = "         Mahatma...
READ MORE - Program to demonstrates the - trim( )

Program to demonstrates the - toCharArray( )

/* Program to demonstrates the - toCharArray( ) */ class toCharArrayDemo {     public static void main(String args[ ])     {         String s =" Java is Object Oriented Language";    ...
READ MORE - Program to demonstrates the - toCharArray( )

Program to demonstrate - toString()

/* Program to demonstrate - toString() */ class Rectangle {     int length;     int width;     Rectangle(int l,int w)     {               ...
READ MORE - Program to demonstrate - toString()

Program for Matrix Multiplication

/*  Program for Matrix Multiplication */ class ThreeDArray {     public static void main(String args[ ])     {         int a[][][]={ { {5,0,2}, {0,0,9}, {4,1,0}, {7,7,7}},                                 ...
READ MORE - Program for Matrix Multiplication

Program to demonstrates the - substring()

/* Program to demonstrates the - substring() */ class substringDemo {     public static void main(String args[ ])     {         String s="India,Nepal,Bhotan,ShriLanka,China";    ...
READ MORE - Program to demonstrates the - substring()

Program to concatenates three strings

/* Program to concatenates three strings */ class StringDemo3 {     public static void main(String args[ ])     {         String name = "Indira";         String...
READ MORE - Program to concatenates three strings

Construct string from subset of char array

/* Construct string from subset of char array */ class StringDemo2 {     public static void main(String[] args)     {         byte ASCII[]={65,66,67,68,69,70};        ...
READ MORE - Construct string from subset of char array

Construct one string from another

/* Construct one string from another */ class StringDemo1 {     public static void main(String[] args)     {         char name[]={'I','N','D','I','A'};        ...
READ MORE - Construct one string from another

Program to demonstrate StringBuffer Methods

/* Program to demonstrate StringBuffer Methods */ class StringBufferDemo {     public static void main(String args[ ])     {         // using length() and capacity()        ...
READ MORE - Program to demonstrate StringBuffer Methods

try,catch and finally blocks in Exception Handling

The try Block:The first step in constructing an exception handler is to enclose the code that might throw an exception within a try block. In general, a try block looks like the following: try { code } catch and finally blocks . . . The segment in...
READ MORE - try,catch and finally blocks in Exception Handling

Types of Exceptions

1. checked exception:      These are exceptional conditions that a well-written application should anticipate and recover from. Example:suppose an application prompts a user for an input file name, then opens the file by passing...
READ MORE - Types of Exceptions

What Is an Exception and it's Advantages?

Definition: An exception is an event, which occurs during the execution of a program, that disrupts the normal flow of the program's instructions. When an error occurs within a method, the method creates an object and hands it off to the runtime...
READ MORE - What Is an Exception and it's Advantages?

Program to demonstrate append() and insert() Functions

import java.lang.System; import java.lang.String; import java.lang.StringBuffer; public class StringBufferApp {  public static void main(String args[]) {   StringBuffer sb = new StringBuffer(" is ");   sb.append("Hot");   sb.append('!');  ...
READ MORE - Program to demonstrate append() and insert() Functions

Program to demonstrate some usefull method in java

import java.lang.System; import java.lang.String; public class StringApp {  public static void main(String args[]) {   String s = " Java Developer's Guide ";   System.out.println(s);   System.out.println(s.toUpperCase());  ...
READ MORE - Program to demonstrate some usefull method in java

Program to demonstrates the - startsWith() and endsWith()

/* Program to demonstrates the - startsWith() and endsWith() */ class startsWith_endsWithDemo {     public static void main(String args[ ])     {     String s1="Yahoo";     System.out.println(s1+"...
READ MORE - Program to demonstrates the - startsWith() and endsWith()

Program to demonstrates the - replace( )

/* Program to demonstrates the - replace( ) */ class replaceDemo {     public static void main(String args[ ])     {         String s1 = "Bye Bye !!";        ...
READ MORE - Program to demonstrates the - replace( )

Program to demonstrates the - regionMatches( )

/* Program to demonstrates the - regionMatches( ) */ class regionMatchesDemo {     public static void main(String args[ ])     {             String s1="Java is object oriented...
READ MORE - Program to demonstrates the - regionMatches( )

Read multiple lines from console using a DataInputStream

/* Read multiple lines from console using a DataInputStream */ import java.io.*;    class ReadDemo3 {     public static void main(String args[ ]) throws IOException     {        ...
READ MORE - Read multiple lines from console using a DataInputStream

Use a DataInputStream to read characters from the console

/* Use a DataInputStream to read characters from the console */ import java.io.DataInputStream;    // load class for reading purpose class ReadDemo1 {     public static void main(String args[ ])     {    ...
READ MORE - Use a DataInputStream to read characters from the console

Read a string from console using a DataInputStream

/* Read a string from console using a DataInputStream */ import java.io.*;    class ReadDemo2 {     public static void main(String args[ ]) throws IOException     {        ...
READ MORE - Read a string from console using a DataInputStream

Program to display squares and cubes of first ten numbers

/* Program to display squares and cubes of first ten numbers */ class ForDemo3 {     public static void main(String args[])     {         int num , square , cube ;        ...
READ MORE - Program to display squares and cubes of first ten numbers

Program To Create Table of 31 to 40

/*  Program To Create Table of 31 to 40  */ import java.io.*; class Tables {  public static void main(String[] arg)  {   for(int i=1;i<=10;i++)    {          for(int j=31;j<=40;j++)    ...
READ MORE - Program To Create Table of 31 to 40

Program To Create Table of 2 to 10

/*  Program To Create Table of  2  to 10 */ import java.io.*; class Tables {  public static void main(String[] arg)  {   for(int i=1;i<=10;i++)    {          for(int j=2;...
READ MORE - Program To Create Table of 2 to 10

Program To Create Table of 11 to 20

/*   Program To Create Table of 11 to 20  */ import java.io.*; class Tables {  public static void main(String[] arg)  {   for(int i=1;i<=10;i++)    {         for(int j=11;j<=20;j++)   ...
READ MORE - Program To Create Table of 11 to 20

using break to exit a for loop

/*  using break to exit a for loop */ class BreakDemo1 {     public static void main(String args[])     {         for(int i =0;i<100;i++)         {    ...
READ MORE - using break to exit a for loop

Program to take Input from User

/*  Program to take Input from User */ import java.io.DataInputStream; class Read {     public static void main(String args[])     {         int i;        ...
READ MORE - Program to take Input from User

Program to convert Rs. into paise

/* Program to convert Rs. into paise */ class P17 {     public static void main(String args[])     {         double rs=75.95;         double paise1,paise2;    ...
READ MORE - Program to convert Rs. into paise

Program to compute distance light travels

/* Program to compute distance light travels */ class P13 {     public static void main(String args[])     {         int lightspeed;         long days, seconds,distance;    ...
READ MORE - Program to compute distance light travels

Program to demonstrate Bitwise Logical operators

/* Program to demonstrate Bitwise Logical operators */ class BitLogic {     public static void main(String args[])     {         int A=35,B=15,C=3;         System.out.println("A...
READ MORE - Program to demonstrate Bitwise Logical operators

Program to demonstrate Bitwise Operator Assignments

/* Program to demonstrate Bitwise Operator Assignments */ class BitAssign {     public static void main(String args[])     {         int A=1,B=2,C=3;         A...
READ MORE - Program to demonstrate Bitwise Operator Assignments

Addition and Subtraction of Integer numbers

/*Program to demonstrate the addition and subtraction of Integer numbers*/   class AddSubInt {   public static void main (String args[])   {         int i = 5;       int j = 3;      ...
READ MORE - Addition and Subtraction of Integer numbers

Program to demonstrate the addition and subtraction of double numbers

/* Program to demonstrate the addition and subtraction of double numbers*/ class AddSubDoubles {      public static void main (String args[])      {         double x = 7.5;    ...
READ MORE - Program to demonstrate the addition and subtraction of double numbers

program to demonstrates inner class

/* program to demonstrates inner class */ class Outer {     int outer_a = 200;     void show()     {         Inner i = new Inner();         i.display();    ...
READ MORE - program to demonstrates inner class

Program to add, delete and print an item in shopping list

/* Program to add, delete and print an item in shopping list  */ import java.util.*; import java.io.DataInputStream;     // to load DataInputStream class             class...
READ MORE - Program to add, delete and print an item in shopping list

Program that accepts a shopping list of five items from the command line and stores them in a vector

/* Program that accepts a shopping list of five items from the command line and stores them in a vector */ import java.util.*;     class P33 {     public static void main(String args[ ])     {    ...
READ MORE - Program that accepts a shopping list of five items from the command line and stores them in a vector

Program to store various types of objects in Vector

/* Program to store various types of objects in Vector */ import java.util.*; class Person {     String FirstName = new String();     String LastName = new String();     Person(String Fname, String Lname)    ...
READ MORE - Program to store various types of objects in Vector

Program that throws a 'NoMatchException' when a string is not equal to “India”

/* Program that throws a 'NoMatchException' when a string is not equal to “India” */ class NoMatchException extends Exception {     private String str;         NoMatchException(String str1)    ...
READ MORE - Program that throws a 'NoMatchException' when a string is not equal to “India”

Program to demonstrates try and multiple catch

/* Program to demonstrates try and multiple catch  */ import java.io.DataInputStream;     // to load DataInputStream class         class P30 {     public static void main(String...
READ MORE - Program to demonstrates try and multiple catch

Program which uses toStirng() method

/* Program which uses toStirng() method   */ import java.io.DataInputStream;     // to load DataInputStream class         class Person {     String FirstName = new...
READ MORE - Program which uses toStirng() method

Program to sort a list of sir names

/* Program to sort a list of sir names   */ import java.io.DataInputStream;     // to load DataInputStream class         class P28 {     public static void main(String...
READ MORE - Program to sort a list of sir names

Program for Question-Answer

/* Program for Question-Answer */ import java.io.DataInputStream;     // to load DataInputStream class         class P26 {     public static void main(String args[ ])    ...
READ MORE - Program for Question-Answer

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|