Advice On First Program (binary to decimal converter)
Alright so I've been trying to learn how to program in java(pretty obvious huh?) and I'm about as new to this as they come, so please be gentle. Ok so for some inexplicable reason I've decided that for my first program I'd like to try making a binary and hexadecimal to decimal converter, that can be used on text files. After about a week this is how far I've gotten:
[Java] Binary.java - Pastebin.com
After finishing that I started working on the hexadecimal part. That's when I discovered the Integer.decode method:
Integer (Java Platform SE 6)
I realized that by simply imitating them and adding a few lines of code I could get this work on binary numbers as well:
[Java] Number.java - Pastebin.com
Basically what I really l'm looking for is some general advice on Binary.java, considering It's the first program I've ever written from scratch. Sooo:
- How's my code, am I using java correctly?
- What am I doing wrong and what could I do better?
- How efficient, comparatively, are these two programs?
- What am I actually telling the jvm to do?
- How many steps are there, are they all necessary?
Hopefully I haven't done or said anything stupid in my first post, if I have please tell me, I'd prefer not to start off on the wrong foot. All advice and criticism welcome!