This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dgstack.dev.jcache; | |
import javax.cache.Cache; | |
import javax.cache.CacheManager; | |
import javax.cache.Caching; | |
import javax.cache.configuration.MutableConfiguration; | |
import javax.cache.spi.CachingProvider; | |
public class JCacheSample { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static io.undertow.servlet.Servlets.servlet; | |
import javax.servlet.ServletException; | |
import org.glassfish.jersey.servlet.ServletContainer; | |
import io.undertow.Handlers; | |
import io.undertow.Undertow; | |
import io.undertow.server.handlers.PathHandler; | |
import io.undertow.servlet.Servlets; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dgstack.eg; | |
import org.eclipse.jetty.server.Server; | |
import org.eclipse.jetty.webapp.WebAppContext; | |
public class JettyServer { | |
public static void main(String[] args) throws Exception { | |
Server server = new Server(8080); | |
WebAppContext context = new WebAppContext(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class SolutionJavaOutString { | |
public static void main(String[] args) { | |
Scanner sc=new Scanner(System.in); | |
System.out.println("================================"); | |
for(int i=0;i<3;i++) | |
{ | |
String s1=sc.next(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
public class TestSubSetProblem { | |
public TestSubSetProblem() { | |
// TODO Auto-generated constructor stub | |
} | |
public static void main(String[] args) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dgstack.dev.test_dev; | |
import java.util.Arrays; | |
public class TestSubSetProblem { | |
public static void main(String[] args) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final Map<String, String> mapFixed = Collections.<String,String>unmodifiableMap(new HashMap<String,String>(){ | |
private static final long serialVersionUID = 1L; | |
{ | |
put("key", "value"); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
println("Hello, World!") | |
println(args!=null) | |
println(args) | |
for{i <- 0 to args.length - 1 } | |
println(" args %d index value is %s ".format(i,args(i))) | |
//There are three string insterpolation method out of the box s, f and raw | |
//Using s String Interpolator | |
val name = "Ashish" | |
println(s"$name mera bagal m betha hai") | |
println(s" 1 + 1 kitna hota hai ${ 1 + 1} hota hai") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ThreadRunnerClass { | |
public static void main(String[] args) { | |
whenPerInstance(); | |
//whenOneInstance(); | |
} | |
public static void whenPerInstance(){ | |
ShareObjectOne s1 = new ShareObjectOne(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.concurrent.Callable; | |
import java.util.concurrent.ExecutionException; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.Future; | |
public class MyTextExcutor{ | |
private static class MyCallableClass implements Callable<String> { |