views:

347

answers:

9

Hello,

I am a computer science in my Student Second year. I already know a good deal about C++, Data Structures, File Structures, OOP, etc.

I decided to learn Java. I have read couple of books but I know that it takes practice to master any Programming language. I was wondering if anyone knew of some assignments or problems that helped them become good at programming. I am looking for something more challenging than "hello world"s and "3+2=5"s exercises.

Thanks, ~HW

+3  A: 

You can Google for some Java Beginner exercises and work on them for yourself, rather than have us assign you assignments (since, no offense, it isn't our job to)

Also, if your school offers on-line syllabus, log onto the following semester class, so if your in CS100 browse at CS101 syllabus and take assignments from there, if offered.

Also as suggested, Project Euler are good puzzles to solve as practice, however I would recommend waiting until you feel comfortable with the language before you dive into Project Euler. This could potentially save you from being discouraged if your unable to complete the puzzles while your experience is still growing.

Anthony Forloney
+5  A: 

Project Euler. A little math's oriented in places, but some good puzzles nonetheless.

Paolo
I was going to recommend PE, but I thought that may be *too* advanced for a beginner considering what they have him doing now, i.e. "Hello World" and simple arithmetic.
Anthony Forloney
haha nobody makes you write "hello world" for 1-2 years in a row. I'm sure he'l be ok, at least with the early puzzles for sure. I think being sharp at math helps in later CS courses too.
muddybruin
+1  A: 

This has been said before on SO, but try some simple games. I like to start with a simple Deck of Cards class and work up from there. Try simple, console-based card games such as Blackjack and War... And eventually you can add a lot more logic, GUI, AI, etc.

froadie
I second this approach, particularly the part about working up after something simple. The biggest difference I found between college and 'the real world' is that you're never 'done' an assignment when it's for a job. The real strength of Java and other OO languages happens after you're done a project... when you need to rework or reuse large chunks of it.
derivation
+2  A: 

If you want something in between "hello world" and Project Euler (or even the practice problems for the Google CodeJam), there's always CodingBat (formerly JavaBat).

CPerkins
+1 for codingBat. That thing is super awesome for beginner practice.
polygenelubricants
+1  A: 

One of my favorites is to write an application that simulates "John Conway's Game of Life"

http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life

Rice Flour Cookies
A: 

It depends on part of java you want to focus on. Are you interested in J2EE or just standard Java for coding non-enterprise apps?

If it's the first one then I would recommend doing something like a simple shopping cart like web app. This will not encompass the myriad of J2EE facets but it will give you a good intro to JSP/Servlets and how to get/put data from/to backing beans.

If it's the latter, then Project Euler or problem sets in acm.uva.es are good places to start - this will teach you java i/o, data structures, file handling, string manipulation etc.

CoolBeans
+1  A: 

I'd recommend http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=3

These assignments are really good for building strong problem solving skills. You have wide range of difficulties from beginner to advanced/master level questions. Once you get a grip on these questions, become comfortable with solving them. Then or even in parallel if you get bored, do something that has application in real life for instance :

  • Program that collects RSS fee then convert it into JSON/XML
  • Something like store inventory
  • Maybe music player that plays music and plays music reverse when you press a button
    these just came out of the top of my head

Just be creative, try to do something that is already done just to get a grip on how things are done. Also you might wanna learn in parallel some other similar stuff like Hibernate, Maven etc. Read books and remember everything has its learning curve. Don't give up, if you get stuck :D

c0mrade
A: 

"I am a computer science in my Student Second year. I already know a good deal about C++, Data Structures, File Structures, OOP, etc."

The concepts that would be most useful for you to master are the ones you've already studied. The only problem is learning the new Java syntax. Assuming you you were given practice C++ exersizes in your first year of CompSci (I'm also a CompSci student) that teach you these concepts, try re-implementing them in Java, taking note of the differences between the Java way of doing things versus the C++ way. Use http://java.sun.com/docs/books/tutorial/ to help you out. It is quite comprehensive for a beginner and teaches you all the things you need to know to get you started, as well as being very accessible if you forget syntax.

CelthiasAlpha
A: 

Start reading a good blog like this one

link text