You are on page 1of 1

public static int maxArr(int[] arr) {

int maxValue = arr[0];


for (int i = 1; i < arr.length; i++) {
if (arr[i] > maxValue) {
maxValue = arr[i];
}
}
return maxValue;
}

--------------------------------------------------------------------
public static String extractFirstn (String str) {
String result = " ";
for(int i=0; i<=str.length(); i++) {
result = str.substring(0,str.length());
}
return result;
}
===============================================================================

public static String extractLastn(String str) {


String result = " ";
int len = str.length();
for (int i = len - 1; i >= 0; i--) {
result = result + str.charAt(i);
}
return result;

}
===================================================================================
=

public static boolean isdigit(char ch) {


boolean b = Character.isDigit(ch);
return b;
}

================================================================

public static boolean Containsdot(String str) {


boolean b = str.contains(".");
return b;
}

===============================================================

public static int lastIndex(String str) {

int result;

result = str.lastIndexOf('.');

return result;
}
=================================================================

You might also like