What do you want to save?
Add Code snippet
New code examples
-
Java 2022-03-03 02:10:10
how to print something in java
//print and create new line after System.out.println("text"); System.out.println(String); //You can use any variable type, not just strings, although //they are the most common //Print without creating a new line System.out.print("text&quo... Add solution -
Java 2022-03-03 01:00:01
Android java toArray to String array
List<String> stockList = new ArrayList<String>(); stockList.add("stock1"); stockList.add("stock2"); String[] stockArr = new String[stockList.size()]; stockArr = stockList.toArray(stockArr); for(String s : stockArr) Sy... Add solution -
Java 2022-03-02 21:55:06
get certain character from string java
String words = "Hi There"; //creating a string var named 'words' char index = words.charAt(0); /* setting a variable 'index' to letter '0' of variable 'words'. In this case, index = 'H'.*/ System.out.println(index); //print var 'index' which wil... Add solution -
Java 2022-03-02 20:05:28
Java program find GCD and LCM of two numbers using euclid’s algorithm
import java.util.Scanner; public class GCDLCMEuclid { // gcd java void findGCD(long num1, long num2) { while(num2 > 0) { long temp = num2; num2 = num1 % num2; num1 = temp; } System.out.printl... Add solution -
Java 2022-03-01 19:40:04
add each element in an array java
import java.util.Arrays; import java.util.Scanner; public class SumOfElementsOfAnArray { public static void main(String args[]){ System.out.println("Enter the required size of the array :: "); &nbs... Add solution -
Other 2022-03-01 16:35:01
Sketch for rotatory encoder
#define encoderOutA 2 // CLK pin of Rotary Enocoder #define encoderOutB 1 // DT pin of Rotary Enocoder int counter = 0; int presentState; int previousState; void setup() { pinMode (encoderOutA,INPUT); pinMode (en... Add solution -
Java 2022-03-01 04:40:02
Java program to find average of n numbers
// Java program to find average of n numbers import java.util.Scanner; public class FindAverageOfNNumbers { public static void main(String[] args) { int num, count = 1; float a, average, total = 0; Scanner sc = new Scanner(S... Add solution -
Java 2022-02-28 06:20:25
java look and feel themes
// Java sample code to get the list of // installed Look and Feel themes, here is a sample code: import javax.swing.UIManager; public class MainClass { public static void main(String[] a) { &nbs... Add solution
Best helpers
Ranking is empty