Posts

Showing posts from April, 2012

Get Sub List of Java ArrayList Example

package com.subList.demo; import java.util.ArrayList; import java.util.List; /**  * This Java Example shows how to get sub list of java ArrayList using subList method.  *  * @author abdul  */ public class SubListDemo {     public static void main(String args[]) {         //create an ArrayList object         List<String> list = new ArrayList<String>();         int range = 4;         //Add elements to Arraylist         list.add("A");         list.add("B");         list.add("C");         list.add("D");         list.add("E");         list.add("F");         list.add(...

Debug Java applications remotely with Eclipse

Image
Remote debugging is a way of debugging any process running on some other location from your development machine. Local debugging is the best way in my opinion and should always be preferred over remote debugging but if local debugging is not possible and there is no way to debug your process then remote debugging is the solution. Many of us work on a project which runs on Linux operating system and we do development mostly on Windows. Eclipse provides us most useful feature called " Remote debugging " by using which you can debug your Linux running process from your windows machine. Now let's see how we can setup remote debugging in Eclipse: Just take a example of a simple program that we want to be debugged: package com.tutoial.debugger; /**  * @author abdul  *  */ public class Debug {     public static void main(String args[]) {         for(int i=1; i<=10;i++) {      ...