Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Snippets

Reply
Thread Tools

Snippets

 
 
bob smith
Guest
Posts: n/a
 
      09-05-2012
Is there a good place where you can get lots of "Snippets" of Java code (like for Eclipse)?

I'm looking for snippets like for "starting a thread."
 
Reply With Quote
 
 
 
 
Eric Sosman
Guest
Posts: n/a
 
      09-05-2012
On 9/5/2012 11:17 AM, bob smith wrote:
> Is there a good place where you can get lots of "Snippets" of Java code (like for Eclipse)?
>
> I'm looking for snippets like for "starting a thread."


Don't know about the general matter, but for the specific
question see

<http://docs.oracle.com/javase/tutorial/essential/concurrency/runthread.html>


--
Eric Sosman
http://www.velocityreviews.com/forums/(E-Mail Removed)d
"The speed at which the system fails is usually not important."
 
Reply With Quote
 
 
 
 
Daniel Pitts
Guest
Posts: n/a
 
      09-05-2012
On 9/5/12 8:17 AM, bob smith wrote:
> Is there a good place where you can get lots of "Snippets" of Java code (like for Eclipse)?
>
> I'm looking for snippets like for "starting a thread."
>

Google is a good place to search for snippets. For your example,
<http://lmgtfy.com/?q=starting+a+thread+in+java>

Though this is a terrible way to program, because people often don't
fully understand what the snippet does (especially if this is the only
way they program). Often times there are multiple ways to approach
something, each with different trade-offs and implications. Simply
copying the first snippet that seems to work will eventually lead to
disaster. This is true with any language, not just Java.

I suggest instead learning how to actually program in Java. Read
tutorials, buy books, ask smart questions.

If you're interested in threading specifically, a must-read is "Java
Concurrency in Practice"

<http://www.amazon.com/dp/0321349601?tag=virtuinfinnet-20&camp=14573&creative=327641&linkCode=as1&creativ eASIN=0321349601&adid=070QHH97QBDPJ8X254PX>

Yes, buying from that link gives me money, but you can search for the
book on Google if you feel they deserve the money more than I do

They have plenty of "snippets" in that book too, BTW.

Anyway, good luck,
Daniel.
 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      09-05-2012
Leif Roar Moldskred wrote:
> bob smith wrote:
> > Is there a good place where you can get lots of "Snippets" of Java code (like for Eclipse)?


"like for Eclipse"? What do you mean?

> There _were_ they O'Reilly Cookbooks for Java, but those are pretty
> old and rather dated now.


Just about every article on IBM's Developerworks for Java site.
https://www.ibm.com/developerworks/java/

--
Lew
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      09-07-2012
On Wed, 5 Sep 2012 08:17:02 -0700 (PDT), bob smith
<(E-Mail Removed)> wrote, quoted or indirectly quoted someone
who said :

>Is there a good place where you can get lots of "Snippets" of Java code (like for Eclipse)?
>
>I'm looking for snippets like for "starting a thread."


If you look up the name of a component or collection in the Java
glossary http://mindprod.com/jgloss/jgloss.html, there will be a self
contained compilable example to demonstrate the basic features of its
use.

You can look up things like JDBC to see how to open various databases,
SQL to do the basic operations, enum for how to do things with
enums...
--
Roedy Green Canadian Mind Products http://mindprod.com
A new scientific truth does not triumph by convincing its opponents and making them see the light,
but rather because its opponents eventually die, and a new generation grows up that is familiar with it.
~ Max Planck 1858-04-23 1947-10-04


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Committing Code Snippets windsurfing_stew@yahoo.com.au ASP .Net 2 12-17-2005 10:22 PM
Code snippets, tool to convert basic to .snippet xml? Edwin Knoppert ASP .Net 0 11-30-2005 03:45 PM
No code snippets built in yet for C# ASP.NET 2.0 beta? Steve Franks ASP .Net 2 09-11-2005 10:36 AM
Where are my Code Snippets? Pat ASP .Net 4 04-23-2005 01:29 PM
Reusing Code Snippets - Steve - ASP .Net 2 10-01-2004 11:29 AM



Advertisments