<?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/"
	>

<channel>
	<title>hackattacking.com</title>
	<atom:link href="http://hackattacking.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://hackattacking.com</link>
	<description>A HACKER is the person who knows the LIFE and CODING very well.</description>
	<pubDate>Thu, 03 Jun 2010 18:24:28 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Example of Generic class with two type parameters.</title>
		<link>http://hackattacking.com/?p=1574</link>
		<comments>http://hackattacking.com/?p=1574#comments</comments>
		<pubDate>Thu, 03 Jun 2010 18:24:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Java]]></category>

		<category><![CDATA[generic class]]></category>

		<category><![CDATA[java code]]></category>

		<category><![CDATA[java example]]></category>

		<guid isPermaLink="false">http://hackattacking.com/?p=1574</guid>
		<description><![CDATA[

class TwoGen&#60;T,V&#62;

{T ob1;

V ob2;

TwoGen(T o1, V o2)

{ ob1=o1;

ob2=o2;

}

void showTypes()

{System.out.println("Type of T is "+ ob1.getClass().getName());

System.out.println("Type of V is "+ ob2.getClass().getName());

}

T getob1()

{ return ob1;

}

V getob2()

{return ob2;

}

}

class GenDemo2

{public static void main(String a[])

{TwoGen&#60;Integer,String&#62; tgobj= new twoGen&#60;Integer,String&#62;(88,"Generics");

tgobj.showTypes();

int t=tgobj.getob1();

System.out.println("value of t: "+t);

String str =tgobj.getob2();

System.out.println("value of str: "+ str);

}
}

]]></description>
		<wfw:commentRss>http://hackattacking.com/?feed=rss2&amp;p=1574</wfw:commentRss>
		</item>
		<item>
		<title>A simple Generics example.</title>
		<link>http://hackattacking.com/?p=1571</link>
		<comments>http://hackattacking.com/?p=1571#comments</comments>
		<pubDate>Thu, 03 Jun 2010 18:14:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Java]]></category>

		<category><![CDATA[generics]]></category>

		<category><![CDATA[java code]]></category>

		<category><![CDATA[java example]]></category>

		<guid isPermaLink="false">http://hackattacking.com/?p=1571</guid>
		<description><![CDATA[

class GenDemo

{ public static void main(String a[])

{ // Create a Gen reference for integers

Gen&#60;Integer&#62; iob;

iob.showType();

int v=iob.getob();

System.out.println("value: "+v);

Gen&#60;String&#62; strob = newGen&#60;String&#62;("Generics Test");

strob.showType();

String str= strob.getob();

System.out.println("value: "+ str);

}

}

class Gen&#60;T&#62;

{T ob;

Gen(T o)

{ob=o;

}

T getob()

{return ob;

}

void showType()

{System.out.println("Type of T is " +ob.getClass().getName());

}
}

]]></description>
		<wfw:commentRss>http://hackattacking.com/?feed=rss2&amp;p=1571</wfw:commentRss>
		</item>
		<item>
		<title>Scanner to read various types of data from a file.</title>
		<link>http://hackattacking.com/?p=1568</link>
		<comments>http://hackattacking.com/?p=1568#comments</comments>
		<pubDate>Thu, 03 Jun 2010 18:03:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Java]]></category>

		<category><![CDATA[File]]></category>

		<category><![CDATA[file input]]></category>

		<category><![CDATA[java code]]></category>

		<category><![CDATA[java example]]></category>

		<category><![CDATA[scanner]]></category>

		<guid isPermaLink="false">http://hackattacking.com/?p=1568</guid>
		<description><![CDATA[This example shows how to use scanner to read various type(like integer, double, boolean, string) of data from a file.


import java.util.*;

import java.lang.io.*;

class ScanMixed{

public static void main(String a[]) throws IOException {

int i;

double d;

boolean b;

String str;

//Write output to a file

FileWriter fout = new FileWriter("test.txt");

fout.write("Testing Scanner 10 12.2 one true two false");

fout.close();

FileReader fin= new FileReader("Test.txt");

Scanner src= new scanner(fin);

// [...]]]></description>
		<wfw:commentRss>http://hackattacking.com/?feed=rss2&amp;p=1568</wfw:commentRss>
		</item>
		<item>
		<title>Scanner to read double numbers from a file and display their average.</title>
		<link>http://hackattacking.com/?p=1565</link>
		<comments>http://hackattacking.com/?p=1565#comments</comments>
		<pubDate>Thu, 03 Jun 2010 17:10:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Java]]></category>

		<category><![CDATA[average of a file]]></category>

		<category><![CDATA[file in java]]></category>

		<category><![CDATA[java code]]></category>

		<category><![CDATA[java example]]></category>

		<category><![CDATA[scanner]]></category>

		<guid isPermaLink="false">http://hackattacking.com/?p=1565</guid>
		<description><![CDATA[It uses scanner to read double numbers from a file and display their  average. It is assumed that input is terminated by the string “done”.


import java.util.*;

import java.io.*;

class AvgFile{

public static void main(String  a[]) throws IOException{

int count =0;

double sum=0;

//Write output to a file.

FileWriter fout= new FileWriter ("test.txt");

fout.write("2 3.4 5 6 7.4 9.1 10.5 done");

fout.close();

FileReader fin= new [...]]]></description>
		<wfw:commentRss>http://hackattacking.com/?feed=rss2&amp;p=1565</wfw:commentRss>
		</item>
		<item>
		<title>Scanner to read double numbers from keyboard and display their average.</title>
		<link>http://hackattacking.com/?p=1561</link>
		<comments>http://hackattacking.com/?p=1561#comments</comments>
		<pubDate>Thu, 03 Jun 2010 16:51:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Java]]></category>

		<category><![CDATA[average of numbers]]></category>

		<category><![CDATA[java code]]></category>

		<category><![CDATA[java.util package]]></category>

		<category><![CDATA[scanner]]></category>

		<guid isPermaLink="false">http://hackattacking.com/?p=1561</guid>
		<description><![CDATA[It uses scanner to read double numbers from keyboard and display their average. It is assumed that input is terminated by the string &#8220;done&#8221;.


import  java.util.*;

class AvgNums{

public static void main (String a[]){

Scanner conin = new  Scanner (System.in);

int count =0;

double sum=0.0;

System.out.println("Enter Numbers:: ");

// Read and Sum numbers

while (conin.hasNext() ) {

if(conin.hasNextDouble () ) {

sum += conin.nextDouble();

count++;

}

else {

String str [...]]]></description>
		<wfw:commentRss>http://hackattacking.com/?feed=rss2&amp;p=1561</wfw:commentRss>
		</item>
		<item>
		<title>Demonstrates The overloading Varargs methods.</title>
		<link>http://hackattacking.com/?p=1558</link>
		<comments>http://hackattacking.com/?p=1558#comments</comments>
		<pubDate>Wed, 02 Jun 2010 19:32:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Java]]></category>

		<category><![CDATA[java code]]></category>

		<category><![CDATA[overloading method]]></category>

		<category><![CDATA[overloading varargs method]]></category>

		<category><![CDATA[varargs]]></category>

		<guid isPermaLink="false">http://hackattacking.com/?p=1558</guid>
		<description><![CDATA[
class VarArgs

{public void Test(int ... v)

{System.out.print("No. of args "+ v.length +"contents ");

for(int i : v)

{System.out.print(i+" ");}

System.out.println();

}

public void Test(boolean ... v)

{System.out.print("No. of args "+ v.length+"contents ");

for(boolean i: v)

{System.out.print(i+ " ");}

System.out.println();

}

public void Test(String str, int ... v)

{System.out.print(str+ v.length+"contents ");

for(boolean i: v)

{System.out.print(i+  " ");}

System.out.println();

}

public static void main(String a[])

{ VarArgs va = nwe VarArgs();

va.Test("Testing me:", 10, 20);

va.Test(11,12,13);

va.Test(true, false, [...]]]></description>
		<wfw:commentRss>http://hackattacking.com/?feed=rss2&amp;p=1558</wfw:commentRss>
		</item>
		<item>
		<title>Demonstrates the VARARGS feature of java for variable arguments along with normal parameters.</title>
		<link>http://hackattacking.com/?p=1555</link>
		<comments>http://hackattacking.com/?p=1555#comments</comments>
		<pubDate>Wed, 02 Jun 2010 19:09:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Java]]></category>

		<category><![CDATA[java code]]></category>

		<category><![CDATA[normal parameter]]></category>

		<category><![CDATA[varargs]]></category>

		<category><![CDATA[variable argument]]></category>

		<category><![CDATA[variable argument with normal parameter]]></category>

		<guid isPermaLink="false">http://hackattacking.com/?p=1555</guid>
		<description><![CDATA[Here we demonstrate how we can pass normal parameter along with varible arguments.

class VarExample

{ public void Test(String str, int ... arr)

{System.out.print(str + arr.length + "contents ");

for(int i : arr){

System.out.print(i+" ");}

System.out.println();

}

public static void main(String a[])

{VarExample ve =new VarExample();

ve.Test("First argument",1);

ve.Test("Second argument", 11, 12,13);

ve.Test(" No variable arguments ");

}
}

]]></description>
		<wfw:commentRss>http://hackattacking.com/?feed=rss2&amp;p=1555</wfw:commentRss>
		</item>
		<item>
		<title>Demonstrates the VARARGS feature of java for variable arguments.</title>
		<link>http://hackattacking.com/?p=1552</link>
		<comments>http://hackattacking.com/?p=1552#comments</comments>
		<pubDate>Wed, 02 Jun 2010 18:54:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Java]]></category>

		<category><![CDATA[java code]]></category>

		<category><![CDATA[Varargs feature]]></category>

		<category><![CDATA[variable argument]]></category>

		<guid isPermaLink="false">http://hackattacking.com/?p=1552</guid>
		<description><![CDATA[This example shows how to use VARAGRS feature of java for variable length arguments instead of using array.

class VarExample

{

public void test(int ... arr)

{

System.out.print("No. of arguments "+arr.length+"contents ");

for(int i: arr)

{ System.out.print( i+ " ");

}

System.out.println();

}

public static void main(String a[])

{ VarExample ve= new varExample() ;

va.Test(10);

va.Test(11,12,13,14);

va.Test();

}
}

]]></description>
		<wfw:commentRss>http://hackattacking.com/?feed=rss2&amp;p=1552</wfw:commentRss>
		</item>
		<item>
		<title>Variable length argument implemented using array.</title>
		<link>http://hackattacking.com/?p=1548</link>
		<comments>http://hackattacking.com/?p=1548#comments</comments>
		<pubDate>Wed, 02 Jun 2010 18:29:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Java]]></category>

		<category><![CDATA[array]]></category>

		<category><![CDATA[java code]]></category>

		<category><![CDATA[variable argument]]></category>

		<guid isPermaLink="false">http://hackattacking.com/?p=1548</guid>
		<description><![CDATA[This Example demonstrates how we can pass variable argument using array, but this approach is old. Now a days we use Varargs feature included in J2SE 5.

class VariableArr{
public void Test(int[] arr)

{ System.out.println("No. of args "+arr.length+"contents ");

for(int i : arr)

{ System.out.print( i+" ");

}

System.out.println();

}

public static void main(String a[])

{ VariableArr va= nw VariableArr();

int a[]= {20};

int b[]={2,4,6};

int c[]= {};

va.test(a);

va.test(b);

va.test(c);

}

}
]]></description>
		<wfw:commentRss>http://hackattacking.com/?feed=rss2&amp;p=1548</wfw:commentRss>
		</item>
		<item>
		<title>Demonstrates the PRECISION modifier in Formatter Class.</title>
		<link>http://hackattacking.com/?p=1545</link>
		<comments>http://hackattacking.com/?p=1545#comments</comments>
		<pubDate>Wed, 02 Jun 2010 18:12:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Java]]></category>

		<category><![CDATA[Formatter class]]></category>

		<category><![CDATA[java code]]></category>

		<category><![CDATA[Precision modifier]]></category>

		<guid isPermaLink="false">http://hackattacking.com/?p=1545</guid>
		<description><![CDATA[A Precision modifier can be applied to any format specifier. It follows the minimum field width specifier(if it is there) and consists of a period followed by an integer.  The default precision is 6. For example, %10.4f  prints a number at least ten character wide with four decimal places. In case of String, it specifies [...]]]></description>
		<wfw:commentRss>http://hackattacking.com/?feed=rss2&amp;p=1545</wfw:commentRss>
		</item>
	</channel>
</rss>
