Skip to content

Instantly share code, notes, and snippets.

View chandrasekhar4u's full-sized avatar
🏠
Working from home

Chandra Sekhar Kakarla chandrasekhar4u

🏠
Working from home
View GitHub Profile
import com.google.common.util.concurrent.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executors;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.Date;
public class UnbufferedClient {
public static void main(String[] args) throws Exception {
URL u = new URL("http://localhost:8080/testapp/AsyncServlet");
InputStreamReader r = new InputStreamReader(u.openConnection().getInputStream());
char [] buf = new char[1024];
int n;
package test.servlet;
import java.io.IOException;
import javax.servlet.AsyncContext;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@chandrasekhar4u
chandrasekhar4u / Swap.java
Created March 11, 2013 08:14
Swap two numbers with out using 3rd variable in java
public class Swap{
public static void main( String[] args ) {
/*int a = 5;
int b = 10;*/
CheckPrimitive cp = new CheckPrimitive();
int a = 5;
int b = 10;
System.out.println( "a first value:" + a );
System.out.println( "b first value:" + b );