<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>JSP, Tomcat, JDBC, Projects, Example, Program &#187; Java</title>
	<atom:link href="http://www.easywayserver.com/blog/category/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.easywayserver.com/blog</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 31 May 2010 04:18:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Java &#8211; Default Capacity of Vector</title>
		<link>http://www.easywayserver.com/blog/java-default-capacity-of-vector/</link>
		<comments>http://www.easywayserver.com/blog/java-default-capacity-of-vector/#comments</comments>
		<pubDate>Mon, 31 May 2010 04:18:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=533</guid>
		<description><![CDATA[Find default capacity of Vector in JAVA
In this example, We will find default capacity of vector in collections in java. 


import java.util.Vector;
public class VectorSize {

	public static void main(String[] args) {

		Vector vc=new Vector();

		System.out.println("Default Capacity of Vector is :"+vc.capacity());

		vc.add("first element");

		System.out.println("Default Capacity of Vector after one element :"+vc.capacity());

		vc.add("second element");

		System.out.println("Default Capacity of Vector after two elements :"+vc.capacity());
	}
}


Output


Default Capacity of [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjava-default-capacity-of-vector%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjava-default-capacity-of-vector%2F" height="61" width="51" /></a></div><p><strong>Find default capacity of Vector in JAVA</strong></p>
<p>In this example, We will find default capacity of vector in collections in java. </p>
<div class="cde cdesize">
<pre>
import java.util.Vector;
public class VectorSize {

	public static void main(String[] args) {

		Vector<String> vc=new Vector<String>();

		System.out.println("Default Capacity of Vector is :"+vc.capacity());

		vc.add("first element");

		System.out.println("Default Capacity of Vector after one element :"+vc.capacity());

		vc.add("second element");

		System.out.println("Default Capacity of Vector after two elements :"+vc.capacity());
	}
}
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
Default Capacity of Vector is :10<br />
Default Capacity of Vector after one element :10<br />
Default Capacity of Vector after two elements :10
</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/java-default-capacity-of-vector/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java &#8211; Remove Duplicate Object in Collection</title>
		<link>http://www.easywayserver.com/blog/java-remove-duplicate-object-in-collection/</link>
		<comments>http://www.easywayserver.com/blog/java-remove-duplicate-object-in-collection/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 03:21:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=531</guid>
		<description><![CDATA[Removing Duplicate Object from Array through collection framework
In this example, We will find and search duplicate elements in array and remove that object from collections in java. 
Duplicate object in array will explain how to remove in java J2EE program and application.

import java.util.*;

public class RemoveDuplicate {

    public static void main(String[] args) {
 [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjava-remove-duplicate-object-in-collection%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjava-remove-duplicate-object-in-collection%2F" height="61" width="51" /></a></div><p><strong>Removing Duplicate Object from Array through collection framework</strong></p>
<p>In this example, We will find and search duplicate elements in array and remove that object from collections in java. </p>
<p>Duplicate object in array will explain how to remove in java J2EE program and application.</p>
<div class="cde cdesize">
<pre><span style='color:#800000; font-weight:bold; '>import</span><span style='color:#004a43; '> java</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>util</span><span style='color:#808030; '>.</span><span style='color:#800000; font-weight:bold; '>*</span><span style='color:#800080; '>;</span>

<span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>class</span> RemoveDuplicate <span style='color:#800080; '>{</span>

    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>static</span> <span style='color:#bb7977; '>void</span> main<span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>String</span><span style='color:#808030; '>[</span><span style='color:#808030; '>]</span> args<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
          ArrayList<span style='color:#808030; '>&lt;</span><span style='color:#bb7977; font-weight:bold; '>String</span><span style='color:#808030; '>></span> arrayList1 <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>new</span> ArrayList<span style='color:#808030; '>&lt;</span><span style='color:#bb7977; font-weight:bold; '>String</span><span style='color:#808030; '>></span><span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

          arrayList1<span style='color:#808030; '>.</span>add<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;A&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
          arrayList1<span style='color:#808030; '>.</span>add<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;A&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
          arrayList1<span style='color:#808030; '>.</span>add<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;B&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
          arrayList1<span style='color:#808030; '>.</span>add<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;B&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
          arrayList1<span style='color:#808030; '>.</span>add<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;B&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
          arrayList1<span style='color:#808030; '>.</span>add<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;C&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

          <span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span><span style='color:#bb7977; '>int</span> i<span style='color:#808030; '>=</span><span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> i<span style='color:#808030; '>&lt;</span> arrayList1<span style='color:#808030; '>.</span>size<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span> i<span style='color:#808030; '>+</span><span style='color:#808030; '>+</span><span style='color:#808030; '>)</span>
          <span style='color:#800080; '>{</span>
            <span style='color:#bb7977; font-weight:bold; '>System</span><span style='color:#808030; '>.</span>out<span style='color:#808030; '>.</span>println<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;Having Duplicate Objects :&quot;</span><span style='color:#808030; '>+</span>arrayList1<span style='color:#808030; '>.</span>get<span style='color:#808030; '>(</span>i<span style='color:#808030; '>)</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
          <span style='color:#800080; '>}</span> 

          Set<span style='color:#808030; '>&lt;</span><span style='color:#bb7977; font-weight:bold; '>String</span><span style='color:#808030; '>></span> s<span style='color:#808030; '>=</span><span style='color:#800000; font-weight:bold; '>new</span> TreeSet<span style='color:#808030; '>&lt;</span><span style='color:#bb7977; font-weight:bold; '>String</span><span style='color:#808030; '>></span><span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
          s<span style='color:#808030; '>.</span>addAll<span style='color:#808030; '>(</span>arrayList1<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

          Iterator it<span style='color:#808030; '>=</span>s<span style='color:#808030; '>.</span>iterator<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
          <span style='color:#800000; font-weight:bold; '>while</span> <span style='color:#808030; '>(</span>it<span style='color:#808030; '>.</span>hasNext<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span>
          <span style='color:#800080; '>{</span>
            <span style='color:#bb7977; font-weight:bold; '>System</span><span style='color:#808030; '>.</span>out<span style='color:#808030; '>.</span>println<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;No Duplicate :&quot;</span><span style='color:#808030; '>+</span><span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>String</span><span style='color:#808030; '>)</span>it<span style='color:#808030; '>.</span>next<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
          <span style='color:#800080; '>}</span> 

    <span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
Having Duplicate Objects :A<br />
Having Duplicate Objects :A<br />
Having Duplicate Objects :B<br />
Having Duplicate Objects :B<br />
Having Duplicate Objects :B<br />
Having Duplicate Objects :C<br />
No Duplicate :A<br />
No Duplicate :B<br />
No Duplicate :C
</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/java-remove-duplicate-object-in-collection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multithreading in Java</title>
		<link>http://www.easywayserver.com/blog/multithreading-in-java/</link>
		<comments>http://www.easywayserver.com/blog/multithreading-in-java/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 16:56:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/multithreading-in-java/</guid>
		<description><![CDATA[Multithreading in Java
In this multithreading programming example, We will use Runnable interface to implements in main class to run multithreading in java. 
Multi threading programming will explain how to use Runnable Interface in java J2EE program and application.
1. MainThreadClass.java

public class MainThreadClass {

    public static void main(String[] args) {

     [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fmultithreading-in-java%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fmultithreading-in-java%2F" height="61" width="51" /></a></div><h1>Multithreading in Java</h1>
<p>In this multithreading programming example, We will use Runnable interface to implements in main class to run multithreading in java. </p>
<p>Multi threading programming will explain how to use Runnable Interface in java J2EE program and application.</p>
<p>1. <strong>MainThreadClass.java</strong></p>
<div class="cde cdesize">
<pre><span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>class</span> MainThreadClass <span style='color:#800080; '>{</span>

    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>static</span> <span style='color:#bb7977; '>void</span> main<span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>String</span><span style='color:#808030; '>[</span><span style='color:#808030; '>]</span> args<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>

        ThreadClass tc1<span style='color:#808030; '>=</span><span style='color:#800000; font-weight:bold; '>new</span> ThreadClass<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;Run&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
        ThreadClass tc2<span style='color:#808030; '>=</span><span style='color:#800000; font-weight:bold; '>new</span> ThreadClass<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;Thread&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

        <span style='color:#bb7977; font-weight:bold; '>Thread</span> t1<span style='color:#808030; '>=</span><span style='color:#800000; font-weight:bold; '>new</span> <span style='color:#bb7977; font-weight:bold; '>Thread</span><span style='color:#808030; '>(</span>tc1<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
        <span style='color:#bb7977; font-weight:bold; '>Thread</span> t2<span style='color:#808030; '>=</span><span style='color:#800000; font-weight:bold; '>new</span> <span style='color:#bb7977; font-weight:bold; '>Thread</span><span style='color:#808030; '>(</span>tc2<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

        t1<span style='color:#808030; '>.</span>start<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
        t2<span style='color:#808030; '>.</span>start<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    <span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
</pre>
</div>
<p>2. <strong>ThreadClass.java</strong></p>
<div class="cde cdesize">
<pre><span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>class</span> ThreadClass <span style='color:#800000; font-weight:bold; '>implements</span> Runnable<span style='color:#800080; '>{</span>

    <span style='color:#bb7977; font-weight:bold; '>String</span> msg<span style='color:#800080; '>;</span>

    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#bb7977; '>void</span> run<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
    <span style='color:#800080; '>{</span>
        <span style='color:#800000; font-weight:bold; '>for</span><span style='color:#808030; '>(</span><span style='color:#bb7977; '>int</span> i<span style='color:#808030; '>=</span><span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>i<span style='color:#808030; '>&lt;</span><span style='color:#808030; '>=</span><span style='color:#008c00; '>5</span><span style='color:#800080; '>;</span>i<span style='color:#808030; '>+</span><span style='color:#808030; '>+</span><span style='color:#808030; '>)</span>
        <span style='color:#800080; '>{</span>
            <span style='color:#bb7977; font-weight:bold; '>System</span><span style='color:#808030; '>.</span>out<span style='color:#808030; '>.</span>println<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;Run method: &quot;</span><span style='color:#808030; '>+</span>msg<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
        <span style='color:#800080; '>}</span>
    <span style='color:#800080; '>}</span>

    ThreadClass<span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>String</span> mg<span style='color:#808030; '>)</span>
    <span style='color:#800080; '>{</span>
        msg<span style='color:#808030; '>=</span>mg<span style='color:#800080; '>;</span>
    <span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
Run method: Run<br />
Run method: Run<br />
Run method: Run<br />
Run method: Thread<br />
Run method: Thread<br />
Run method: Thread<br />
Run method: Run<br />
Run method: Run<br />
Run method: Thread<br />
Run method: Thread<br />
Run method: Run<br />
Run method: Thread
</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/multithreading-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java &#8211; Multithreading Example with Thread Class</title>
		<link>http://www.easywayserver.com/blog/java-multithreading-example-with-thread-class/</link>
		<comments>http://www.easywayserver.com/blog/java-multithreading-example-with-thread-class/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 16:32:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=528</guid>
		<description><![CDATA[Java MultiThreading Example 
In this multithreading example, We will use Thread class to extends in main class to run multithreading in java. 
Multi threading will explain how to use Thread class in java J2EE program and code.
1. MainThreadClass.java

public class MainThreadClass {

    public static void main(String[] args) {

      [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjava-multithreading-example-with-thread-class%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjava-multithreading-example-with-thread-class%2F" height="61" width="51" /></a></div><p><strong>Java MultiThreading Example</strong> </p>
<p>In this multithreading example, We will use Thread class to extends in main class to run multithreading in java. </p>
<p>Multi threading will explain how to use Thread class in java J2EE program and code.</p>
<p>1. <strong>MainThreadClass.java</strong></p>
<div class="cde cdesize">
<pre><span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>class</span> MainThreadClass <span style='color:#800080; '>{</span>

    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>static</span> <span style='color:#bb7977; '>void</span> main<span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>String</span><span style='color:#808030; '>[</span><span style='color:#808030; '>]</span> args<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>

        ThreadClass dt1<span style='color:#808030; '>=</span><span style='color:#800000; font-weight:bold; '>new</span> ThreadClass<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;Run&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
        ThreadClass dt2<span style='color:#808030; '>=</span><span style='color:#800000; font-weight:bold; '>new</span> ThreadClass<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;Thread&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

        dt1<span style='color:#808030; '>.</span>start<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span> <span style='color:#696969; '>// this will start thread of object 1</span>
        dt2<span style='color:#808030; '>.</span>start<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span> <span style='color:#696969; '>// this will start thread of object 2</span>
    <span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
</pre>
</div>
<p>2. <strong>ThreadClass.java</strong></p>
<div class="cde cdesize">
<pre><span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>class</span> ThreadClass <span style='color:#800000; font-weight:bold; '>extends</span> Thread<span style='color:#800080; '>{</span>

    <span style='color:#bb7977; font-weight:bold; '>String</span> msg<span style='color:#800080; '>;</span>

    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#bb7977; '>void</span> run<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
    <span style='color:#800080; '>{</span>
        <span style='color:#800000; font-weight:bold; '>for</span><span style='color:#808030; '>(</span><span style='color:#bb7977; '>int</span> i<span style='color:#808030; '>=</span><span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>i<span style='color:#808030; '>&lt;</span><span style='color:#808030; '>=</span><span style='color:#008c00; '>5</span><span style='color:#800080; '>;</span>i<span style='color:#808030; '>+</span><span style='color:#808030; '>+</span><span style='color:#808030; '>)</span>
        <span style='color:#800080; '>{</span>
            <span style='color:#bb7977; font-weight:bold; '>System</span><span style='color:#808030; '>.</span>out<span style='color:#808030; '>.</span>println<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;Run method: &quot;</span><span style='color:#808030; '>+</span>msg<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
        <span style='color:#800080; '>}</span>
    <span style='color:#800080; '>}</span>

    ThreadClass<span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>String</span> mg<span style='color:#808030; '>)</span>
    <span style='color:#800080; '>{</span>
        msg<span style='color:#808030; '>=</span>mg<span style='color:#800080; '>;</span>
    <span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
Run method: Run<br />
Run method: Run<br />
Run method: Run<br />
Run method: Thread<br />
Run method: Run<br />
Run method: Run<br />
Run method: Thread<br />
Run method: Thread<br />
Run method: Thread<br />
Run method: Thread<br />
Run method: Run<br />
Run method: Thread
</p>
</div>
<p>Multithreading can be used in print commands</p>
]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/java-multithreading-example-with-thread-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java &#8211; Interface Example</title>
		<link>http://www.easywayserver.com/blog/java-interface-example/</link>
		<comments>http://www.easywayserver.com/blog/java-interface-example/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 14:53:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=495</guid>
		<description><![CDATA[Java interface example
This example will explain how to implement interface in java
Interface
JavaInterface.java

/**
&#xa0;* This is interface which can implement in java class
&#xa0;*/
public interface JavaInterface {

    public void add();

    public void delete();

    public void find();

    public void edit();

}



class which implementing interface
JavaClassInterfaceExample.java

public class JavaClassInterfaceExample implements JavaInterface{

 [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjava-interface-example%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjava-interface-example%2F" height="61" width="51" /></a></div><p>Java interface example</p>
<p>This example will explain how to implement interface in java</p>
<p>Interface</p>
<p><strong>JavaInterface.java</strong></p>
<div class="cde">
<pre><span style='color:#3f5fbf; '>/**</span>
<span style='color:#3f5fbf; '>&#xa0;</span><span style='color:#7f9fbf; font-weight:bold; '>*</span><span style='color:#3f5fbf; '> This is interface which can implement in java class</span>
<span style='color:#3f5fbf; '>&#xa0;*/</span>
<span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>interface</span> JavaInterface <span style='color:#800080; '>{</span>

    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#bb7977; '>void</span> add<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#bb7977; '>void</span> delete<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#bb7977; '>void</span> find<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#bb7977; '>void</span> edit<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

<span style='color:#800080; '>}</span>
</pre>
</div>
<p></p>
<p>class which implementing interface</p>
<p><strong>JavaClassInterfaceExample.java</strong></p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>class</span> JavaClassInterfaceExample <span style='color:#800000; font-weight:bold; '>implements</span> JavaInterface<span style='color:#800080; '>{</span>

    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#bb7977; '>void</span> add<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
    <span style='color:#800080; '>{</span>
        <span style='color:#696969; '>// statements</span>
        <span style='color:#bb7977; font-weight:bold; '>System</span><span style='color:#808030; '>.</span>out<span style='color:#808030; '>.</span>println<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;add method implement by interface&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    <span style='color:#800080; '>}</span>

    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#bb7977; '>void</span> edit<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
    <span style='color:#800080; '>{</span>
        <span style='color:#696969; '>// statements</span>
    <span style='color:#800080; '>}</span>

    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#bb7977; '>void</span> find<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
    <span style='color:#800080; '>{</span>
        <span style='color:#696969; '>// statements</span>
    <span style='color:#800080; '>}</span>

    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#bb7977; '>void</span> delete<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
    <span style='color:#800080; '>{</span>
        <span style='color:#696969; '>// statements</span>
    <span style='color:#800080; '>}</span>

    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>static</span> <span style='color:#bb7977; '>void</span> main<span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>String</span> args<span style='color:#808030; '>[</span><span style='color:#808030; '>]</span><span style='color:#808030; '>)</span>
    <span style='color:#800080; '>{</span>
        JavaClassInterfaceExample jie <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>new</span> JavaClassInterfaceExample<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
        jie<span style='color:#808030; '>.</span>add<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    <span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
add method implement by interface
</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/java-interface-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java &#8211; Read file without DataInputStream</title>
		<link>http://www.easywayserver.com/blog/java-read-file-without-datainputstream/</link>
		<comments>http://www.easywayserver.com/blog/java-read-file-without-datainputstream/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 13:45:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[java.io]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=493</guid>
		<description><![CDATA[Read File in java without DataInputStream class. DataInputStream class is deprecated. Instead of DataInputStream class we can use BufferedReader to read file in java.
This example will explain read file in java.

import java.io.File;
import java.io.FileInputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class JavaReadFileExample {

    public static void main(String[] args) {

        File [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjava-read-file-without-datainputstream%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjava-read-file-without-datainputstream%2F" height="61" width="51" /></a></div><p>Read File in java without DataInputStream class. DataInputStream class is deprecated. Instead of DataInputStream class we can use BufferedReader to read file in java.</p>
<p>This example will explain read file in java.</p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>import</span><span style='color:#004a43; '> java</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>io</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>File</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>import</span><span style='color:#004a43; '> java</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>io</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>FileInputStream</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>import</span><span style='color:#004a43; '> java</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>io</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>BufferedReader</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>import</span><span style='color:#004a43; '> java</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>io</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>InputStreamReader</span><span style='color:#800080; '>;</span>

<span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>class</span> JavaReadFileExample <span style='color:#800080; '>{</span>

    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>static</span> <span style='color:#bb7977; '>void</span> main<span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>String</span><span style='color:#808030; '>[</span><span style='color:#808030; '>]</span> args<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>

        <span style='color:#bb7977; font-weight:bold; '>File</span> f<span style='color:#808030; '>=</span><span style='color:#800000; font-weight:bold; '>new</span> <span style='color:#bb7977; font-weight:bold; '>File</span><span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;c:</span><span style='color:#0f69ff; '>\\</span><span style='color:#0000e6; '>readFileinJava.txt&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

        <span style='color:#800000; font-weight:bold; '>try</span> <span style='color:#800080; '>{</span>
            <span style='color:#bb7977; font-weight:bold; '>FileInputStream</span> fs <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>new</span> <span style='color:#bb7977; font-weight:bold; '>FileInputStream</span><span style='color:#808030; '>(</span>f<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
            <span style='color:#bb7977; font-weight:bold; '>InputStreamReader</span> in <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>new</span> <span style='color:#bb7977; font-weight:bold; '>InputStreamReader</span><span style='color:#808030; '>(</span>fs<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
            <span style='color:#bb7977; font-weight:bold; '>BufferedReader</span> br <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>new</span> <span style='color:#bb7977; font-weight:bold; '>BufferedReader</span><span style='color:#808030; '>(</span>in<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

            <span style='color:#bb7977; font-weight:bold; '>String</span> text<span style='color:#800080; '>;</span>

            <span style='color:#800000; font-weight:bold; '>while</span><span style='color:#808030; '>(</span><span style='color:#800000; font-weight:bold; '>true</span><span style='color:#808030; '>)</span>
            <span style='color:#800080; '>{</span>
                text<span style='color:#808030; '>=</span>br<span style='color:#808030; '>.</span>readLine<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
                <span style='color:#800000; font-weight:bold; '>if</span><span style='color:#808030; '>(</span>text<span style='color:#808030; '>=</span><span style='color:#808030; '>=</span><span style='color:#800000; font-weight:bold; '>null</span><span style='color:#808030; '>)</span>
                    <span style='color:#800000; font-weight:bold; '>break</span><span style='color:#800080; '>;</span>
                <span style='color:#bb7977; font-weight:bold; '>System</span><span style='color:#808030; '>.</span>out<span style='color:#808030; '>.</span>println<span style='color:#808030; '>(</span>text<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
            <span style='color:#800080; '>}</span>
        <span style='color:#800080; '>}</span>
        <span style='color:#800000; font-weight:bold; '>catch</span> <span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>Exception</span> e<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
            e<span style='color:#808030; '>.</span>printStackTrace<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
        <span style='color:#800080; '>}</span>
    <span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/java-read-file-without-datainputstream/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java &#8211; Run shell command in java</title>
		<link>http://www.easywayserver.com/blog/java-run-shell-command-in-java/</link>
		<comments>http://www.easywayserver.com/blog/java-run-shell-command-in-java/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 13:33:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[java.io]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=491</guid>
		<description><![CDATA[Execute Shell command can be run by Runtime class. Shell can be executed in linux or unix platform. 
This example will explain how to run shell commands in java and execute commands in java.

public class JavaRunCommandExample {

    public static void main(String[] args) {

        Runtime r [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjava-run-shell-command-in-java%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjava-run-shell-command-in-java%2F" height="61" width="51" /></a></div><p>Execute Shell command can be run by Runtime class. Shell can be executed in linux or unix platform. </p>
<p>This example will explain how to run shell commands in java and execute commands in java.</p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>class</span> JavaRunCommandExample <span style='color:#800080; '>{</span>

    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>static</span> <span style='color:#bb7977; '>void</span> main<span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>String</span><span style='color:#808030; '>[</span><span style='color:#808030; '>]</span> args<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>

        <span style='color:#bb7977; font-weight:bold; '>Runtime</span> r <span style='color:#808030; '>=</span> <span style='color:#bb7977; font-weight:bold; '>Runtime</span><span style='color:#808030; '>.</span>getRuntime<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
        <span style='color:#bb7977; font-weight:bold; '>Process</span> p <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>null</span><span style='color:#800080; '>;</span>
        <span style='color:#bb7977; font-weight:bold; '>String</span> cmd<span style='color:#808030; '>[</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#800080; '>{</span><span style='color:#0000e6; '>&quot;/bin/sh&quot;</span><span style='color:#808030; '>,</span><span style='color:#0000e6; '>&quot;ls&quot;</span><span style='color:#808030; '>,</span><span style='color:#0000e6; '>&quot;-l&quot;</span><span style='color:#800080; '>}</span><span style='color:#800080; '>;</span>

        <span style='color:#800000; font-weight:bold; '>try</span> <span style='color:#800080; '>{</span>
            p <span style='color:#808030; '>=</span> r<span style='color:#808030; '>.</span>exec<span style='color:#808030; '>(</span>cmd<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
        <span style='color:#800080; '>}</span> <span style='color:#800000; font-weight:bold; '>catch</span> <span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>Exception</span> e<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
            e<span style='color:#808030; '>.</span>printStackTrace<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
        <span style='color:#800080; '>}</span>
    <span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/java-run-shell-command-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java &#8211; Run ssh commands in linux</title>
		<link>http://www.easywayserver.com/blog/java-run-ssh-commands-in-linux/</link>
		<comments>http://www.easywayserver.com/blog/java-run-ssh-commands-in-linux/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 10:50:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JSP]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=488</guid>
		<description><![CDATA[To execute ssh command in Linux, we need to use java API to run command at Unix machine. java ssh API is required to run linux commands through ssh with user Authentication. 
This example will explain how to execute ssh in java.
Download ganymed ssh jar and set classpath before running program

import java.io.*;
import ch.ethz.ssh2.*;
public class JavaRunSshCommandExample [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjava-run-ssh-commands-in-linux%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjava-run-ssh-commands-in-linux%2F" height="61" width="51" /></a></div><p>To execute ssh command in Linux, we need to use java API to run command at Unix machine. <a href="http://www.ganymed.ethz.ch/ssh2/">java ssh API</a> is required to run linux commands through ssh with user Authentication. </p>
<p>This example will explain how to execute ssh in java.</p>
<p><a href="http://www.ganymed.ethz.ch/ssh2/">Download ganymed ssh jar and set classpath before running program</a></p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>import</span><span style='color:#004a43; '> java</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>io</span><span style='color:#808030; '>.</span><span style='color:#800000; font-weight:bold; '>*</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>import</span><span style='color:#004a43; '> ch</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>ethz</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>ssh2</span><span style='color:#808030; '>.</span><span style='color:#800000; font-weight:bold; '>*</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>class</span> JavaRunSshCommandExample <span style='color:#800080; '>{</span>

    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>static</span> <span style='color:#bb7977; '>void</span> main<span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>String</span><span style='color:#808030; '>[</span><span style='color:#808030; '>]</span> args<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>

        <span style='color:#bb7977; font-weight:bold; '>String</span> hostname <span style='color:#808030; '>=</span> <span style='color:#0000e6; '>&quot;127.0.0.1&quot;</span><span style='color:#800080; '>;</span>
        <span style='color:#bb7977; font-weight:bold; '>String</span> username <span style='color:#808030; '>=</span> <span style='color:#0000e6; '>&quot;root&quot;</span><span style='color:#800080; '>;</span>
        <span style='color:#bb7977; font-weight:bold; '>String</span> password <span style='color:#808030; '>=</span> <span style='color:#0000e6; '>&quot;password&quot;</span><span style='color:#800080; '>;</span>

        <span style='color:#bb7977; '>boolean</span> isAuthenticated <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>false</span><span style='color:#800080; '>;</span>

        <span style='color:#800000; font-weight:bold; '>try</span>
        <span style='color:#800080; '>{</span>
            <span style='color:#bb7977; font-weight:bold; '>Connection</span> conn <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>new</span> <span style='color:#bb7977; font-weight:bold; '>Connection</span><span style='color:#808030; '>(</span>hostname<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

            conn<span style='color:#808030; '>.</span>connect<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

            isAuthenticated<span style='color:#808030; '>=</span>conn<span style='color:#808030; '>.</span>authenticateWithPassword<span style='color:#808030; '>(</span>username<span style='color:#808030; '>,</span> password<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

            <span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>isAuthenticated <span style='color:#808030; '>=</span><span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>false</span><span style='color:#808030; '>)</span>
                <span style='color:#800000; font-weight:bold; '>throw</span> <span style='color:#800000; font-weight:bold; '>new</span> <span style='color:#bb7977; font-weight:bold; '>IOException</span><span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;Authentication failed.&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

            Session sess <span style='color:#808030; '>=</span> conn<span style='color:#808030; '>.</span>openSession<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

            sess<span style='color:#808030; '>.</span>execCommand<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;cd /;ls -l> out.txt&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

            <span style='color:#bb7977; font-weight:bold; '>InputStream</span> stdout <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>new</span> StreamGobbler<span style='color:#808030; '>(</span>sess<span style='color:#808030; '>.</span>getStdout<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
            <span style='color:#bb7977; font-weight:bold; '>InputStream</span> stderr <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>new</span> StreamGobbler<span style='color:#808030; '>(</span>sess<span style='color:#808030; '>.</span>getStderr<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

            <span style='color:#bb7977; font-weight:bold; '>InputStreamReader</span> insrout<span style='color:#808030; '>=</span><span style='color:#800000; font-weight:bold; '>new</span> <span style='color:#bb7977; font-weight:bold; '>InputStreamReader</span><span style='color:#808030; '>(</span>stdout<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
            <span style='color:#bb7977; font-weight:bold; '>InputStreamReader</span> insrerr<span style='color:#808030; '>=</span><span style='color:#800000; font-weight:bold; '>new</span> <span style='color:#bb7977; font-weight:bold; '>InputStreamReader</span><span style='color:#808030; '>(</span>stderr<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

            <span style='color:#bb7977; font-weight:bold; '>BufferedReader</span> stdoutReader <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>new</span> <span style='color:#bb7977; font-weight:bold; '>BufferedReader</span><span style='color:#808030; '>(</span>insrout<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

            <span style='color:#bb7977; font-weight:bold; '>BufferedReader</span> stderrReader <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>new</span> <span style='color:#bb7977; font-weight:bold; '>BufferedReader</span><span style='color:#808030; '>(</span>insrerr<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

            <span style='color:#800000; font-weight:bold; '>while</span> <span style='color:#808030; '>(</span><span style='color:#800000; font-weight:bold; '>true</span><span style='color:#808030; '>)</span>
            <span style='color:#800080; '>{</span>
                <span style='color:#bb7977; font-weight:bold; '>String</span> line <span style='color:#808030; '>=</span> stdoutReader<span style='color:#808030; '>.</span>readLine<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
                <span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>line <span style='color:#808030; '>=</span><span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>null</span><span style='color:#808030; '>)</span>
                <span style='color:#800080; '>{</span>
                    <span style='color:#800000; font-weight:bold; '>break</span><span style='color:#800080; '>;</span>
                <span style='color:#800080; '>}</span>
                <span style='color:#bb7977; font-weight:bold; '>System</span><span style='color:#808030; '>.</span>out<span style='color:#808030; '>.</span>println<span style='color:#808030; '>(</span>line<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
            <span style='color:#800080; '>}</span>

            <span style='color:#800000; font-weight:bold; '>while</span> <span style='color:#808030; '>(</span><span style='color:#800000; font-weight:bold; '>true</span><span style='color:#808030; '>)</span>
            <span style='color:#800080; '>{</span>
                <span style='color:#bb7977; font-weight:bold; '>String</span> line <span style='color:#808030; '>=</span> stderrReader<span style='color:#808030; '>.</span>readLine<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
                <span style='color:#800000; font-weight:bold; '>if</span> <span style='color:#808030; '>(</span>line <span style='color:#808030; '>=</span><span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>null</span><span style='color:#808030; '>)</span>
                <span style='color:#800080; '>{</span>    <span style='color:#800000; font-weight:bold; '>break</span><span style='color:#800080; '>;</span><span style='color:#800080; '>}</span>
                <span style='color:#bb7977; font-weight:bold; '>System</span><span style='color:#808030; '>.</span>out<span style='color:#808030; '>.</span>println<span style='color:#808030; '>(</span>line<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
            <span style='color:#800080; '>}</span>

            sess<span style='color:#808030; '>.</span>close<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

            conn<span style='color:#808030; '>.</span>close<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
        <span style='color:#800080; '>}</span>
        <span style='color:#800000; font-weight:bold; '>catch</span> <span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>IOException</span> e<span style='color:#808030; '>)</span>
        <span style='color:#800080; '>{</span>
            e<span style='color:#808030; '>.</span>printStackTrace<span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>System</span><span style='color:#808030; '>.</span>err<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
            <span style='color:#bb7977; font-weight:bold; '>System</span><span style='color:#808030; '>.</span>exit<span style='color:#808030; '>(</span><span style='color:#008c00; '>2</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
        <span style='color:#800080; '>}</span>
    <span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
</pre>
</div>
<p>Other java ssh api</p>
<p><a href="http://sourceforge.net/projects/sshtools/">Download j2ssh api</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/java-run-ssh-commands-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java &#8211; Edit File Example, Modify File java</title>
		<link>http://www.easywayserver.com/blog/java-edit-file-example-modify-file-java/</link>
		<comments>http://www.easywayserver.com/blog/java-edit-file-example-modify-file-java/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 10:02:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[java.io]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=484</guid>
		<description><![CDATA[File can be appended by File class and other input output stream. To write content in a file in java we need to use java.io package.  File class is used to create a file at specific path. We can use either StringBuffer for text and content to store in file.  In java we [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjava-edit-file-example-modify-file-java%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjava-edit-file-example-modify-file-java%2F" height="61" width="51" /></a></div><p>File can be appended by File class and other input output stream. To write content in a file in java we need to use java.io package.  File class is used to create a file at specific path. We can use either StringBuffer for text and content to store in file.  In java we can write file with FileWriter class with BufferedWriter class. write() method is used to create file and write the content in file.</p>
<p>To edit file in java we need to search text which replace with new text. indexOf() method will search text in java and append() method will modify old content in string.</p>
<p>This example will explain how to edit file in java and modify text in file by java.</p>
<p>text file in c drive</p>
<div class="cde">
<p>Content in this text, abc change xyz with new content by java io package </p>
</div>
<p></p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>import</span><span style='color:#004a43; '> java</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>io</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>BufferedReader</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>import</span><span style='color:#004a43; '> java</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>io</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>BufferedWriter</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>import</span><span style='color:#004a43; '> java</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>io</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>File</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>import</span><span style='color:#004a43; '> java</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>io</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>FileInputStream</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>import</span><span style='color:#004a43; '> java</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>io</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>FileNotFoundException</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>import</span><span style='color:#004a43; '> java</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>io</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>FileWriter</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>import</span><span style='color:#004a43; '> java</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>io</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>IOException</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>import</span><span style='color:#004a43; '> java</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>io</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>InputStreamReader</span><span style='color:#800080; '>;</span>

<span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>class</span> JavaIOEditFileExample <span style='color:#800080; '>{</span>

    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>static</span> <span style='color:#bb7977; '>void</span> main<span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>String</span><span style='color:#808030; '>[</span><span style='color:#808030; '>]</span> args<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>

        <span style='color:#bb7977; font-weight:bold; '>File</span> f<span style='color:#808030; '>=</span><span style='color:#800000; font-weight:bold; '>new</span> <span style='color:#bb7977; font-weight:bold; '>File</span><span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;c:</span><span style='color:#0f69ff; '>\\</span><span style='color:#0000e6; '>appendOldFile.txt&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

        <span style='color:#bb7977; font-weight:bold; '>FileInputStream</span> fs <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>null</span><span style='color:#800080; '>;</span>
        <span style='color:#bb7977; font-weight:bold; '>InputStreamReader</span> in <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>null</span><span style='color:#800080; '>;</span>
        <span style='color:#bb7977; font-weight:bold; '>BufferedReader</span> br <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>null</span><span style='color:#800080; '>;</span>

        <span style='color:#bb7977; font-weight:bold; '>StringBuffer</span> sb <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>new</span> <span style='color:#bb7977; font-weight:bold; '>StringBuffer</span><span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

        <span style='color:#bb7977; font-weight:bold; '>String</span> textinLine<span style='color:#800080; '>;</span>

        <span style='color:#800000; font-weight:bold; '>try</span> <span style='color:#800080; '>{</span>
             fs <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>new</span> <span style='color:#bb7977; font-weight:bold; '>FileInputStream</span><span style='color:#808030; '>(</span>f<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
             in <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>new</span> <span style='color:#bb7977; font-weight:bold; '>InputStreamReader</span><span style='color:#808030; '>(</span>fs<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
             br <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>new</span> <span style='color:#bb7977; font-weight:bold; '>BufferedReader</span><span style='color:#808030; '>(</span>in<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

            <span style='color:#800000; font-weight:bold; '>while</span><span style='color:#808030; '>(</span><span style='color:#800000; font-weight:bold; '>true</span><span style='color:#808030; '>)</span>
            <span style='color:#800080; '>{</span>
                textinLine<span style='color:#808030; '>=</span>br<span style='color:#808030; '>.</span>readLine<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
                <span style='color:#800000; font-weight:bold; '>if</span><span style='color:#808030; '>(</span>textinLine<span style='color:#808030; '>=</span><span style='color:#808030; '>=</span><span style='color:#800000; font-weight:bold; '>null</span><span style='color:#808030; '>)</span>
                    <span style='color:#800000; font-weight:bold; '>break</span><span style='color:#800080; '>;</span>
                sb<span style='color:#808030; '>.</span>append<span style='color:#808030; '>(</span>textinLine<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
            <span style='color:#800080; '>}</span>
              <span style='color:#bb7977; font-weight:bold; '>String</span> textToEdit1 <span style='color:#808030; '>=</span> <span style='color:#0000e6; '>&quot;abc&quot;</span><span style='color:#800080; '>;</span>
              <span style='color:#bb7977; '>int</span> cnt1 <span style='color:#808030; '>=</span> sb<span style='color:#808030; '>.</span>indexOf<span style='color:#808030; '>(</span>textToEdit1<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
              sb<span style='color:#808030; '>.</span>replace<span style='color:#808030; '>(</span>cnt1<span style='color:#808030; '>,</span>cnt1<span style='color:#808030; '>+</span>textToEdit1<span style='color:#808030; '>.</span>length<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>,</span><span style='color:#0000e6; '>&quot;New Append text&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

              <span style='color:#bb7977; font-weight:bold; '>String</span> textToEdit2 <span style='color:#808030; '>=</span> <span style='color:#0000e6; '>&quot;xyz&quot;</span><span style='color:#800080; '>;</span>
              <span style='color:#bb7977; '>int</span> cnt2 <span style='color:#808030; '>=</span> sb<span style='color:#808030; '>.</span>indexOf<span style='color:#808030; '>(</span>textToEdit2<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
              sb<span style='color:#808030; '>.</span>replace<span style='color:#808030; '>(</span>cnt2<span style='color:#808030; '>,</span>cnt2<span style='color:#808030; '>+</span>textToEdit2<span style='color:#808030; '>.</span>length<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>,</span><span style='color:#0000e6; '>&quot;Second new edit text&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

              fs<span style='color:#808030; '>.</span>close<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
              in<span style='color:#808030; '>.</span>close<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
              br<span style='color:#808030; '>.</span>close<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

            <span style='color:#800080; '>}</span> <span style='color:#800000; font-weight:bold; '>catch</span> <span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>FileNotFoundException</span> e<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
              e<span style='color:#808030; '>.</span>printStackTrace<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
            <span style='color:#800080; '>}</span> <span style='color:#800000; font-weight:bold; '>catch</span> <span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>IOException</span> e<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
              e<span style='color:#808030; '>.</span>printStackTrace<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
            <span style='color:#800080; '>}</span>

            <span style='color:#800000; font-weight:bold; '>try</span><span style='color:#800080; '>{</span>
                <span style='color:#bb7977; font-weight:bold; '>FileWriter</span> fstream <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>new</span> <span style='color:#bb7977; font-weight:bold; '>FileWriter</span><span style='color:#808030; '>(</span>f<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
                <span style='color:#bb7977; font-weight:bold; '>BufferedWriter</span> outobj <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>new</span> <span style='color:#bb7977; font-weight:bold; '>BufferedWriter</span><span style='color:#808030; '>(</span>fstream<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
                outobj<span style='color:#808030; '>.</span>write<span style='color:#808030; '>(</span>sb<span style='color:#808030; '>.</span>toString<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
                outobj<span style='color:#808030; '>.</span>close<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

            <span style='color:#800080; '>}</span><span style='color:#800000; font-weight:bold; '>catch</span> <span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>Exception</span> e<span style='color:#808030; '>)</span><span style='color:#800080; '>{</span>
              <span style='color:#bb7977; font-weight:bold; '>System</span><span style='color:#808030; '>.</span>err<span style='color:#808030; '>.</span>println<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;Error: &quot;</span> <span style='color:#808030; '>+</span> e<span style='color:#808030; '>.</span>getMessage<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
            <span style='color:#800080; '>}</span>
    <span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
Content in this text, <strong>New Append text</strong> change <strong>Second new edit text</strong> with new content by java io package
</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/java-edit-file-example-modify-file-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java &#8211; How to execute command in java</title>
		<link>http://www.easywayserver.com/blog/java-how-to-execute-command-in-java/</link>
		<comments>http://www.easywayserver.com/blog/java-how-to-execute-command-in-java/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 15:45:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[runtime]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=482</guid>
		<description><![CDATA[Runtime class is part of java.lang package. Runtime class helps us to execute command in operating system with process class. exec() method execute command in java with command in array string. This example will execute to open notepad in window.
Java runtime class example explains How to execute a command java.

public class JavaRunTimeCommandExecuteExample {

   [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjava-how-to-execute-command-in-java%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjava-how-to-execute-command-in-java%2F" height="61" width="51" /></a></div><p>Runtime class is part of java.lang package. Runtime class helps us to execute command in operating system with process class. exec() method execute command in java with command in array string. This example will execute to open notepad in window.</p>
<p>Java runtime class example explains How to execute a command java.</p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>class</span> JavaRunTimeCommandExecuteExample <span style='color:#800080; '>{</span>

    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>static</span> <span style='color:#bb7977; '>void</span> main<span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>String</span><span style='color:#808030; '>[</span><span style='color:#808030; '>]</span> args<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>

        <span style='color:#bb7977; font-weight:bold; '>Runtime</span> r <span style='color:#808030; '>=</span> <span style='color:#bb7977; font-weight:bold; '>Runtime</span><span style='color:#808030; '>.</span>getRuntime<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
        <span style='color:#bb7977; font-weight:bold; '>Process</span> p <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>null</span><span style='color:#800080; '>;</span>
        <span style='color:#bb7977; font-weight:bold; '>String</span> cmd<span style='color:#808030; '>[</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span> <span style='color:#800080; '>{</span><span style='color:#0000e6; '>&quot;notepad.exe&quot;</span><span style='color:#800080; '>}</span><span style='color:#800080; '>;</span>
        <span style='color:#800000; font-weight:bold; '>try</span> <span style='color:#800080; '>{</span>
            p <span style='color:#808030; '>=</span> r<span style='color:#808030; '>.</span>exec<span style='color:#808030; '>(</span>cmd<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
        <span style='color:#800080; '>}</span> <span style='color:#800000; font-weight:bold; '>catch</span> <span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>Exception</span> e<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
            <span style='color:#bb7977; font-weight:bold; '>System</span><span style='color:#808030; '>.</span>out<span style='color:#808030; '>.</span>println<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;error executing &quot;</span> <span style='color:#808030; '>+</span> cmd<span style='color:#808030; '>[</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>]</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
        <span style='color:#800080; '>}</span>
    <span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/java-how-to-execute-command-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
