What do you want to save?
Add Code snippet
New code examples
-
Java 2021-09-07 03:20:02
how to read file from console in java
Scanner in = new Scanner(System.in); System.out.println("Enter file path"); String s = in.nextLine(); //C:\\testing.txt br = new BufferedReader(new FileReader(s)); // And to use that file path in the FIleReader use like this; Add solution -
Java 2021-09-05 02:03:01
how to scan a String in Java
import java.util.Scanner; // import scanner Scanner myScanner = new Scanner(System.in); // Make scanner obj String inputString = myScanner.nextLine(); // Take whole line boolean inputBoolean = myScanner.nextBoolean(); //Boolean input long inputLong ... Add solution -
Java 2021-09-03 20:49:01
sum in range
//Java program to print the sum of numbers in a given rangeimport java.util.Scanner;public class sum_of_numbers_in_range{ public static void main(String[] args) { //scanner class declaration Scanner sc = new Scanner(System.in); //input from user Syst... Add solution -
Java 2021-09-02 10:22:02
Java program to swap two numbers using function
import java.util.Scanner; // java swap function public class SwapTwoNumberDemo { int numOne, numTwo; public void swapNum(SwapTwoNumberDemo stn) { int temp; temp = stn.numOne; stn.numOne = stn.numTwo; stn.numTwo = temp; ... Add solution -
Java 2021-08-31 16:37:01
area of equilateral triangle java
import java.util.Scanner; public class AreaOfEquilateral { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Please enter the side of equilateral triangle: "); double side =... Add solution