Java projects for beginner
Hello everyone
I've been learning Java (reading Thinking in Java + other resources) for few months now and I want to work on a project, like make a program that I can use. So far, I learned about inheritance, polymorphism, inner classes, collection framework, string manipulation,arrays and currently learning about Generics. What kind of programs I can write with such knowledge ?
I have ideas like writing a messenger, a media player or a program that checks if a given text is availble in one of the files of the hardrive or not, but there is a lot to learn in order to do such thing i guess.
Your help is so much appreciated !
Re: Java projects for beginner
Write a program that complements your interests, and start small. Or you could check out Project Euler.
Re: Java projects for beginner
I came up with some lists for you of little programming "assignments" that you could try. I don't know if you've learned GUI yet, though, so I've sorted these into GUI and not GUI for you.
You don't have to use GUI for these:
- make a program that can do your math homework. That is, write different programs for every type of math problem you come across. It's good practice and I found actually helped me understand the stuff I learned in math class more too.
- learn the theory behind quicksort or mergesort and try to write your own implementation of it (it's challenging but fun)
- write a program that recursively prints out the Fibonnaci sequence - the user inputs how many numbers it should print out
- a program that generates random math problems for the user to solve and keeps track of how many you get right and wrong
- One cool thing I did last year was to write a program that knew Latin grammar (which is straightforward enough to be taught to a program) and quizzed me on noun and verb endings. If you learn French or something, you could write a program that quizzes you on the tenses of verbs based on their endings. I put all the bases in a text file and had my program read from that and add random endings. I found it pretty useful. Just an idea.
- a program that prints out Pascal's triangle
- a program that tries to guess a number from 1 to 100 that you've picked. The user can say "higher" or "lower" after each guess. The program takes this information to figure out what the next best guess would be, and says that.
If you learn GUIs, you can do a lot more:
- Two-player tic-tac-toe game that detects wins and ties
- Slightly harder: tic-tac-toe where your program plays the user (your program has artificial intelligence, yay)
- Program where a ball bounces around the JPanel (collision detection included: it bounces off walls and your mouse)
- Minesweeper - this is kind of difficult.
- Sierpinski's triangle - make your program draw the triangle with RECURSION!
- Tetris
Really, making any sort of game is a lot of fun. Try making up your own.
If you want to make something you can use, that is much harder. Here are some suggestions:
- learn Java networking and play around with sockets. Try to create a simple chat program between two computers in the same network. (A client class and server class.)
- learn how to read text files, and write a program that can search a given text file to see if a certain word or phrase appears in it (or better yet, counts the number of times it appears)
- a media player is, I imagine, quite hard, but you could try a simple program where the user can draw on the JPanel and then save the drawing. It's not that much to learn - I learned a lot by just googling and reading the API.
Re: Java projects for beginner
wow thanks a lot !
First off I don't know GUI, I thought finishing the book (Thinking in Java) first is a better idea as i would learn other stuff (generics, concurrency, I/O etc) before getting into GUI.
I actually thought of the three suggestions you put at the end. As for the first, i did almost all of them in high school with Pascal and I didn't want to make them again cause it would sound like "I'm writing same program but with a different language" rather than making use of the language (Java).
Anyways, i'll keep going back to your suggestions, the list is full of interesting stuff !! thanks a lot
Re: Java projects for beginner
Yeah, it's true that you should learn the basics before learning how to dress up with GUIs. But whenever you get the chance, learn GUI! It's not hard to get into, but it can be challenging in a fun way, and it's like the last step before actually being able to design useful programs or games.
By the way, I've heard great things about that book. Did you find it a good Java book?
Re: Java projects for beginner
Yes it is definitely a great book. I covers a lot of subjects in a detailed way. Almost everything explained in words is demonstrated in code ! I learned a lot by typing the code and experimenting with i, without mentioning the amount of exercises it has. However, one must have a programming background in order to be able to understand it. it's a big book to read and the one who suggested it to me told me that i don't have to read it from cover to cover but every chapter is "seducing". It also comes with a cd. but i couldn't get it as i printed a PDF version of the book instead of buying it (i couldn't find it in Tunisia unfortunately)