<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>p2p.wrox.com Forums - Java Basics</title>
		<link>http://p2p.wrox.com</link>
		<description><![CDATA[General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.]]></description>
		<language>en</language>
		<lastBuildDate>Sun, 22 Nov 2009 00:19:37 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://p2p.wrox.com/images/misc/rss.jpg</url>
			<title>p2p.wrox.com Forums - Java Basics</title>
			<link>http://p2p.wrox.com</link>
		</image>
		<item>
			<title>Book recommendation for someone new to Java?</title>
			<link>http://p2p.wrox.com/java-basics/77080-book-recommendation-someone-new-java.html</link>
			<pubDate>Wed, 18 Nov 2009 20:13:31 GMT</pubDate>
			<description><![CDATA[Our team is just now getting involved with Java development using the Oracle WebLogic server. None of us has any Java experience and we're looking...]]></description>
			<content:encoded><![CDATA[<div>Our team is just now getting involved with Java development using the Oracle WebLogic server. None of us has any Java experience and we're looking for a good book that we can use as an initial reference to Java. We all have C# .NET experience and some of us have C/C++ experience, but no Java experience.<br />
<br />
Can anyone recommend a good book to get us started with Java?<br />
<br />
Thanks for any suggestions.<br />
-Dave</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/java-basics-199/">Java Basics</category>
			<dc:creator>DaveHerrmann</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/java-basics/77080-book-recommendation-someone-new-java.html</guid>
		</item>
		<item>
			<title>Write multiple object in a single file</title>
			<link>http://p2p.wrox.com/java-basics/76895-write-multiple-object-single-file.html</link>
			<pubDate>Wed, 04 Nov 2009 10:45:16 GMT</pubDate>
			<description>Hello Everybody
How are you all? I have some little problem. But there is no suitable solution in the internet. My problem:

I want to write multiple...</description>
			<content:encoded><![CDATA[<div>Hello Everybody<br />
How are you all? I have some little problem. But there is no suitable solution in the internet. My problem:<br />
<br />
I want to write multiple object in a single file. But i cant. I can write a single object in the file using writeObject() method. Can any one help me to give a better solution? For your kind consideration my code given below:<br />
<br />
public  void writeObject ( String fullFilename, Object object )<br />
    {<br />
        <br />
        // create the object file<br />
<br />
        File objectFile = new File(fullFilename);<br />
<br />
        // generic stream to the file<br />
<br />
        FileOutputStream outStream;<br />
<br />
        // stream for objects to the file<br />
<br />
        ObjectOutputStream objStream;<br />
<br />
        <br />
<br />
        try<br />
<br />
        {<br />
<br />
              // setup a stream to a physical file on the filesystem<br />
<br />
              outStream = new FileOutputStream ( objectFile );<br />
<br />
              <br />
<br />
              // attach a stream capable of writing objects to the stream that<br />
<br />
              // is connected to the file<br />
<br />
              objStream = new ObjectOutputStream ( outStream );<br />
<br />
              // write object to file<br />
<br />
              objStream.writeObject( object );<br />
<br />
              <br />
<br />
              // close down the streams<br />
<br />
              objStream.close();<br />
<br />
              outStream.close();<br />
<br />
        }<br />
<br />
        catch ( IOException e )<br />
<br />
        {<br />
<br />
              logger.error( &quot;could  not write object to file &quot;,e);<br />
<br />
        }<br />
<br />
  }</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/java-basics-199/">Java Basics</category>
			<dc:creator>Shimul Mahmud</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/java-basics/76895-write-multiple-object-single-file.html</guid>
		</item>
		<item>
			<title>Crypto question</title>
			<link>http://p2p.wrox.com/java-basics/76790-crypto-question.html</link>
			<pubDate>Tue, 27 Oct 2009 20:29:38 GMT</pubDate>
			<description><![CDATA[I'm taking my first programming class, and we're using java. I've been getting the hang of everything so far, but functions are starting to leave me...]]></description>
			<content:encoded><![CDATA[<div>I'm taking my first programming class, and we're using java. I've been getting the hang of everything so far, but functions are starting to leave me in the dust I think.  I'm currently working on a project that is supposed to encrypt or decrypt a phrase, and I'm stuck.<br />
<br />
I'm not sure how to convert a phrase the user inputs from the 'key' string (correct alphabet) to my 'alpha' string (jumbled alphabet). Can anyone help me out?<br />
<br />
Here is the program so far:<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">import java.util.*;<br />
<br />
public class Crypto {<br />
<br />
&nbsp; static Scanner input = new Scanner(System.in);<br />
&nbsp; static String alpha = &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&quot;;<br />
&nbsp; static String key = &quot;UBWKOVGAPRFJLCQHZENSXDMYTI&quot;;<br />
&nbsp; &nbsp; <br />
&nbsp; public static void main(String[] args) {<br />
&nbsp; &nbsp; boolean keepGoing = true;<br />
&nbsp; &nbsp; while(keepGoing){<br />
<br />
&nbsp; &nbsp; &nbsp; String response = menu();<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (response.equals(&quot;1&quot;)){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println(&quot;Please enter unencrypted phrase&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String plain = input.nextLine();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; plain = plain.toUpperCase();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println(encrypt(plain));<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; } else if (response.equals(&quot;2&quot;)){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println(&quot;Please enter encrypted phrase&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String code = input.nextLine();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; code = code.toUpperCase();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println(decrypt(code));<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; } else if (response.equals(&quot;0&quot;)){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println(&quot;Goodbye!&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; keepGoing = false;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; } else {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println(&quot;Sorry. I didn't understand&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; } // end if<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; } // end while<br />
&nbsp; &nbsp; <br />
&nbsp;  } // end main&nbsp; &nbsp; <br />
&nbsp; <br />
&nbsp; public static String menu(){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println(&quot;Crypto Machine&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println(&quot;&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println(&quot;Please enter a selection.&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println(&quot;0) Quit&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println(&quot;1) Encrypt a phrase.&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println(&quot;2) Decrypt a phrase.&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String result = input.nextLine();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return result;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; } //end menu<br />
&nbsp; <br />
&nbsp; public static String decrypt(){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; } //end decrypt<br />
<br />
<br />
&nbsp; public static String encrypt(){<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; } //end encrypt<br />
&nbsp; <br />
} // end Crypto</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/java-basics-199/">Java Basics</category>
			<dc:creator>scott128</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/java-basics/76790-crypto-question.html</guid>
		</item>
	</channel>
</rss>
