What do you want to save?
Add Code snippet
New code examples
-
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 -
Java 2022-03-07 06:10:01
add second to date java
/* w w w . j a va 2s . c om*/ import java.util.Calendar; import java.util.Date; public class Main { public static void main(String[] args) { System.out.println(addSeconds(new Date(), 100)); } public static Date addSeconds(Date date, In... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5