Jun 28 2009

Parameter passing

Category: Javaadmin @ 7:43 am

  • Without Parameter passing

class calculator {
 
public static void main (String[] args)
 
{
int x = 3;
int y = 5;
 
int add = x + y;
System.out.println(add);
int mul = x * y;
System.out.println(mul);
}
}
class calculator {
public static void main (String[] args)
 
{
System.out.println(11+12);
System.out.println(30+50);
System.out.println(2+3);
System.out.println(60+2);
System.out.println(11+35);
System.out.println(37+50);
System.out.println(52+3);
System.out.println(20+2);
}
}

  • Parameter passing

class calculator {
 
public static void main (String[] args)
 
{
int no1 , no2 ;
no1 = 3;
no2 = 5;	
 
addition (no1,no2);
multiplication (no1,no2);
 
}
 
public static int addition(int x,int y)
 
{
int add = x + y;
System.out.println(add);
}
 
public static int multiplication(int x,int y)
 
{
int mul = x * y;
System.out.println(mul);
}
 
}
class calculator {
public static void main (String[] args)
 
{
add(11,12);
add(30,50);
add(2,3);
add(60,2);
add(11,35);
add(37,50);
add(52,3);
add(20,2);
 
}
 
static void add(int x,int y){
System.out.println(x+y);
}
}

Tags: ,


Jun 17 2009

Blogger Backup

Category: Newsadmin @ 11:42 am

The Blogger Backup utility is intended to be a simple utility to backup to local disk your Blogger posts.

Using the GData C# Library, the utility will walk backward in time, from your latest post to your last, saving each post to a local Atom/XML file.

Download Blogger Backup

Tags:


Jun 15 2009

Simple Methods

Category: Javaadmin @ 11:23 am

public class methods {
	public static void main (String[] args)
 
	{
 
	 addition ();
	 multiplication ();	
 
	}
 
	public static void addition()
 
	{
		int no1 = 10;
		int no2 = 15;
		int add = no1+no2;
		System.out.println(add);
	}
 
	public static void multiplication()
 
	{
		int no3 = 12;
		int no4 = 10;
		int mul = no3*no4;
		System.out.println(mul);
	}
}

Tags: , , ,


Next Page »