This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Vowels { | |
public static int getCount(String str) { | |
int vowelsCount = 0; | |
vowelsCount = str.length() - str.replaceAll("a|e|i|o|u", "").length(); | |
return vowelsCount; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DivisibleNb { | |
public static Boolean isDivisible(long n, long x, long y) { | |
return (n % x == 0 && n % y == 0); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class Clock | |
{ | |
public static int Past(int h, int m, int s) | |
{ | |
Date d = new Date(); | |
int year = d.getYear(); | |
int month = d.getMonth(); | |
int day = d.getDate(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
public class GiftSorter{ | |
public String sortGiftCode(String code){ | |
String[] arrayOfSymbol = code.split(""); | |
Arrays.sort(arrayOfSymbol); | |
StringBuilder sb = new StringBuilder(); | |
for (String oneSymbol: arrayOfSymbol) | |
sb.append(oneSymbol); |
NewerOlder