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 -
Other 2022-03-11 10:35:02
take input from user in java using scanner
import java.util.*; class UserInputDemo { public static void main(String[] args) { Scanner sc= new Scanner(System.in); //... Add solution -
Java 2022-03-11 09:20:22
spring tcp inbound-outbound channel adapter example
@Configuration() @EnableIntegration @IntegrationComponentScan public class ServerConfiguration implements ApplicationListener<TcpConnectionEvent> { private final int port = SocketUtils.findAvailableServerSocket(5000); @MessagingGateway(defaultRequ... Add solution -
Java 2022-03-11 08:50:14
how to calculate 30 days from a date in java
package com.mkyong.time; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class DateExample { private static final DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd... Add solution -
Java 2022-03-10 17:45:02
how to compare a char to a string java
public class JavaCharacterCompareExample1 { public static void main(String[] args) { char firstValue = 'A'; char secondValue = 'B'; // compare the first char to the second int result = Character.compare(firstValue, secondValue); if (resul... Add solution -
Java 2022-03-09 00:05:13
length vs length() method in java
length() : In String class we have length() method which is used to return the number of characters in string. Ex : String str = “Hello World”; System.out.println(str.length()); Str.length() will return 11 characters including space. leng... Add solution -
Java 2022-03-08 13:25:15
how to check object type in java
// obj instanceof Class /*example*/ String str = "a String made by the String class"; if(str instanceof String) System.out.println("This is True"); if(str instanceof float) System.out.println("This will never be on your screen&... Add solution -
Javascript 2022-03-08 12:30:11
javascript date custom string format
var date = new Date(Date.UTC(2012, 11, 20, 3, 0, 0, 200)); // request a weekday along with a long date var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }; console.log(new Intl.DateTimeFormat('de-DE', options).format(date));... Add solution
Best helpers
Ranking is empty