Skip to main content

Posts

Showing posts from July, 2015

INPUT TAKEN USING "DATA INPUT STREAM"

import java.io.*; class   ReadFromDataInputStream{     public static void main(String[] args) throws Exception{             DataInputStream in = new DataInputStream(System.in);             System.out.println("Enter Name: ");             String name=in.readLine();             System.out.println("Name is: "+name);             }    }

Class & Object

class Sample {             int a,b;             void setAll(int i,int j)             {                         a=i;                         b=j;             }             void showAll( )             {                         System.out.println("a= " + a + " b="+b);      ...

First program of java

class Sum2 /*class name*/ {             public static void main(String args[ ])             {                         int a,b,c;                         a=Integer.parseInt(args[0]);                         b=Integer.parseInt(args[1]);                         /*calculate the sum */                      ...