Program.in

By Santosh Wadghule

Archive for August 13th, 2007

Simple Function call program

without comments

This java program is very simple to understand that how one function calls to another function.
here, main function calls the santosh and anil function.

public class FunctCall
public static void santosh () {
System.out.println ("Inside the santosh fuction");
}
public static void main (String[] args) {
int val;
System.out.println ("Inside main");
santosh();
System.out.println ("About to call anil function");
val = anil(4);
System.out.println ("anil returned a value of " + val);
System.out.println ("About to call anil again");
val = anil(-2);
System.out.println ("anil returned a value of " + val);
}
public static int anil (int param) {
System.out.println ("Inside anil with param " + param);
return param * 2;
}
}

Written by Santosh Wadghule

August 13, 2007 at 5:23 pm

Posted in Java, Uncategorized

HelloDate

without comments

This java program is to show the date of month.

import java.util.*;
public class HelloDate {
public static void main (String[] args) {
System.out.println ("Hello, it's: ");
System.out.println(new Date());
}
}

Written by Santosh Wadghule

August 13, 2007 at 4:43 pm

Posted in Java, Uncategorized