What do you want to save?
Add Code snippet
New code examples
-
-
Java 2021-10-26 19:02:18
java check if string appears twice in arraylist
//same as the Grepper awnser but for anything //gets the amount of times the object appears in the array public static int amountOfTimesObjectAppearsInArray(ArrayList<?> array, Object checkMe) { int numCount = 0; for (Object o : array) { ... Add solution -
Java 2021-10-26 18:32:13
Java Console Ordering System
import java.util.*; public class cart{ //To publicly access the quantity as it updates every time you wish to buy again public static int total_quantity=0; //I have declared 4 products here public static String[] products = {null, "1.) Q... Add solution -
Java 2021-10-26 08:51:12
count occurrences in seven integers using java single dimension arrays
import java.util.Scanner; public class SevenNumbersCount { public static int count(int[] arr, int num) { int count = 0; for(int i = 0; i < arr.length; ++i) { // go through all elements in array if(arr[i] == num) { //... Add solution -
Java 2021-10-25 07:12:14
a recursive function that calculates the greatest common divisor from user's input in java
/** * Java program to demonstrate How to find Greatest Common Divisor or GCD of * two numbers using Euclid’s method. There are other methods as well to * find GCD of two number in Java but this example of finding GCD of two number * is most si... Add solution -
Other 2021-10-25 05:57:06
get enum from enum description
public static int GetEnumFromDescription(string description, Type enumType) { foreach (var field in enumType.GetFields()) { DescriptionAttribute attribute = Attribute.GetCustomAttribute(field, typeof(DescriptionAttribute))as De... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5