What do you want to save?
Add Code snippet
New code examples
-
Java 2021-09-20 10:15:02
arraylist length
import java.util.ArrayList; /* * Java Program to find the length of ArrayList. * */ public class ArrayListDemo{ public static void main(String[] args) { System.out.println("Welcome to Java Program to find the length of array list"); ... Add solution -
Java 2021-09-16 03:07:02
Is the main method compulsory in Java?
// Java Program to demonstrate till Java JDK5 version // without main() method is possible. class WithoutMainMethod { static { int i = 2, j = 4, sum; sum = i + j; System.out.println("The sum of i and j is :" + sum); System.out.println("This... Add solution -
Java 2021-09-08 04:04:04
Java program to remove consonants from a string
// Java program to remove consonants from a string import java.util.Arrays; import java.util.List; public class RemoveConsonantsFromString { public static void main(String[] args) { String str = "hello world core java"; System... 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-03 13:32:02
java what is static
//Java Program to get the cube of a given number using the static method using static before a method or variable we can access it by not creating a instance of it.in the program we directly used student.cube(5) class Calculate{ static int cube(int... Add solution -
Java 2021-08-31 13:02:02
java how to split a string into letters
//Java program to show the use of Split method (Java 8 and above) public class SplitString{ public static void main(String[] args) { //Initialize the String which needs to be split String str = "Enlighter"; //Use the Split... Add solution