What do you want to save?
Add Code snippet
New code examples
-
Java 2022-03-11 11:35:19
Java program to print prime numbers from 2 to n
// Java program to print prime numbers from 2 to n import java.util.Scanner; public class PrimeNumberFrom2Ton { public static void main(String[] args) { int loop, max; System.out.print("Please enter highest (maximum) number: "... Add solution -
Java 2022-02-22 20:10:19
Multiply two numbers without using arithmetic operators in java
import java.util.Scanner; public class MultiplyWithoutArithmeticOperators { static int multiplyNumber(int num1, int num2) { int output = 0; boolean boolNegative = (num1 < 0 && num2 >= 0) || (num2 < 0 && num1 >... Add solution -
Java 2021-10-12 10:09:02
checking file writable java
import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; public class FilesExample { public static void main(String args[]) { //Creating a Path object Path path = Paths.get(&... Add solution -
Java 2021-10-11 08:45:09
how to make a static reference in jave
import java.util.Scanner; public class StudentMarks { Scanner scan1 = new Scanner(System.in); private double math; private double science; private double english; public StudentMarks(double ... Add solution -
Java 2021-09-25 22:54:05
array declaration injava
// both are valid declarations int intArray[]; or int[] intArray; byte byteArray[]; short shortsArray[]; boolean booleanArray[]; long longArray[]; float floatArray[]; double doubleArray[]; char charArray[]; // an array of references to objects of // t... Add solution -
Other 2021-09-01 03:23:02
int cannot be converted to boolean
public class Demo { public static void main(String[] args) { int val = 100; System.out.println("Integer: "+val); boolean bool = (val == 100); System... Add solution