#1
| |||
| |||
Methods in JAVA I am new to JAVA and its php codes. While working on Java from last coule of days, i came to know there are some methods in JAVA. To be frank i don't have any idea about these methods. Could you guys please explain me what are these methods in JAVA ? Thanks in advance. |
#2
| |||
| |||
Re: Methods in JAVA A method is a group of instructions that is given a name and can be called up at any point in a program simply by quoting that name. You can also call Java method as a set of Java statements which can be included inside a Java class.Here is an example of a typical method declaration: Code: public double calculateAnswer(double wingSpan, int numberOfEngines, double length, double grossTons) { //do the calculation here } |
#3
| |||
| |||
Re: Methods in JAVA The method is called by the statement calculation(). Every Java program must have one main() method because they are similar to functions or procedures in other programming languages.The only required elements of a method declaration are the method's return type, name, a pair of parentheses, (), and a body between braces, {}. More generally, method declarations have six components, in order:
|
#4
| |||
| |||
Re: Methods in JAVA The idea of methods appears in all programming languages, although sometimes it goes under the name functions and sometimes under the name procedures.The Java programming language supports overloading methods, and Java can distinguish between methods with different method signatures. This means that methods within a class can have the same name if they have different parameter lists. |
![]() |
|
Tags: java methods, javascript, php |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Identify active methods in java | Maya Angelou | Software Development | 4 | 06-04-2010 01:53 PM |
What is Export Methods in Java? | NIcaBoy | Software Development | 4 | 13-02-2010 06:29 AM |
Explain the difference between == & .equals methods in Java? | Harpreet Gaur | Software Development | 5 | 30-01-2010 11:36 AM |
Native methods of java | Truster | Software Development | 5 | 22-01-2010 10:52 AM |
join() and isAlive() methods of java | Owen Fernandes | Software Development | 5 | 21-01-2010 08:28 AM |