Snippets

B

bob smith

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."
 
D

Daniel Pitts

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...tiveASIN=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.
 
R

Roedy Green

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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top