Results 1 to 3 of 3
Thread: How to use a function in java
- 02-15-2008, 05:46 PM #1
Member
- Join Date
- Feb 2008
- Posts
- 1
- Rep Power
- 0
- 02-15-2008, 11:47 PM #2
Member
- Join Date
- Dec 2007
- Posts
- 30
- Rep Power
- 0
This should help you understand the basics.public class Testing {
public static int add(int a, int b) {
return (a + b);
}
public static void main(String[] args) {
int result = add(4, 5);
System.out.println(result);
}
}
- 02-16-2008, 02:57 AM #3
In Java, functions are more typically referred to as methods. See the tutorial on methods for defining them.
Welcome to the forums! See you around :)Vote for the new slogan to our beloved Java Forums! (closes on September 4, 2008)
Want to voice your opinion on your IDE/Editor of choice? Vote now!
Got a little Capt'n in you? (drink responsibly)
Similar Threads
-
Need a little help with a function!
By Nuluvius in forum New To JavaReplies: 3Last Post: 02-07-2008, 11:33 PM -
Use Perl function with java
By lenny in forum Advanced JavaReplies: 1Last Post: 08-07-2007, 06:25 AM -
function name
By osval in forum Advanced JavaReplies: 1Last Post: 08-06-2007, 08:56 PM -
Help with recursive function in java
By cachi in forum Advanced JavaReplies: 2Last Post: 07-31-2007, 06:51 PM -
Php explode function, equivalent java
By fernando in forum Advanced JavaReplies: 1Last Post: 07-31-2007, 05:44 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks