What Are the Functions
What Are the Functions
Inbuilt functions
Created by
Vijay Laul
What are the Functions?
• Functions sometimes take some arguments and return some value after
completing the task.
• Some functions are predefined. They are readily available to do different tasks. Some pre-defined
functions are print(), println(), sqrt() etc.
//statements
}
PROGRAM :-
package functons;
public static int add(int a, int b) { //function add takes two integer input and return
another integer value
sum = a + b;
}
What are inbuilt functions?
Categories of Built-in Methods:-
i) String Methods
• concat() Method :-
(It concatenates two strings /Joins two strings)
package Demo;
public class inbulitFunction {
public static void main (String [] args )
{
String str1 = “Maharastra”;
String str2 = “Pune”;
System.out.println(str1.concat(str2)); // MaharastraPune
}}
Equals() Method :-
public static void main (String [] args )
{
String str1 = “Maharastra”;
String str2 = “Pune”;
System.out.println(str1.equals(str2)); // false
}
Thank You