What do you want to save?
Add Code snippet
New code examples
-
Other 2022-01-30 18:51:52
oops concepts
OOP focuses on the objects that are required to be manipulated instead of logic. - It makes development and maintenance easier - It provides data hiding - It provides ability to simulate real-world - less memory and organized - reusable OOP language fol... Add solution -
Java 2022-01-30 01:55:02
binary search program in java
// Java implementation of iterative Binary Search class BinarySearch { // Returns index of x if it is present in arr[], // else return -1 int binarySearch(int arr[], int x) { int l = 0, r = arr.length - 1; while (l <= r) { int m = l ... Add solution -
Java 2022-01-29 21:40:54
Java create new file
import java.io.FileWriter; // Import the FileWriter class import java.io.IOException; // Import the IOException class to handle errors public class WriteToFile { public static void main(String[] args) { try { FileWriter myWriter = new File... Add solution -
Other 2022-01-29 04:15:02
run antlr
$ cd /usr/local/lib $ sudo curl -O https://www.antlr.org/download/antlr-4.9.2-complete.jar $ export CLASSPATH=".:/usr/local/lib/antlr-4.9.2-complete.jar:$CLASSPATH" $ alias antlr4='java -jar /usr/local/lib/antlr-4.9.2-complete.jar' $ alias grun=... Add solution -
Java 2022-01-28 21:07:43
Java Find the greatest common divisor of two positive integers. The integers can be large, so you need to find a clever solution.
import static java.math.BigInteger.valueOf; import java.math.BigInteger; public class GCD { public static int compute(int x, int y) { return valueOf(x).gcd(valueOf(y)).intValue(); } } Code language: Java (java) Add solution