Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Becoming a Java developer

 
Richard Newman
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I'm about 2 months into studying having never been exposed to Java coding before (though I did have some Javascript background but not a ton). I have read through several prep books for the Java Programmers I exam and I understand the concepts fairly well. I feel like I could write programs using the stuff on the exam with a little bit of time and trial and error. However, I bought a book of study questions for the exam and the questions are blowing me out of the water. It feels like the study questions are asking the most obscure things, and in quite a few cases showing you HORRIBLE coding and asking you to figure out what Java would do to handle this bad code that even the worst coder would know not to write. Can someone make some suggestions as to how I should proceed? I need to understand Java, but I also need to get the certificate and learn to write API's (b/c those are the two contingencies I've been given to get a job at a very nice company from a friend of the family that works there). How practical is it (for a fresh to Java guy like myself) to try to pass the exam sometime soon? Are the exam questions really as obscure and nasty as I'm seeing in this question book by Hanumant Deshmukh?
 
Mike. J. Thompson
Bartender
Posts: 689
17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you got an example of a question you're struggling with? Are these questions meant to be representative of the exam you're preparing for.

Have you got any past papers or practice papers for the exam? I can't know if you're ready to take the exam though.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to CodeRanch!

Yes, the exam shows you some examples of horrible code. I haven't read that book, but I just looked at the sample questions in the preview. Except for the one asking for the state of two variables at each line, the first few all looked reasonable.

Have you read a book on Java other than a study guide? If so, I recommend you put down the study guide and start with that. Head First Java, Thinking in Java, Core Java, Deitel & Deitel, etc. Any of these are good choices to start out with. Once you know the fundamentals, you can use the study guide for its intended purpose. To get you ready to see the details you'll need to pass the exam. Trial and error coding won't be enough to pass the exam.

Also, there are mock exams you can buy to supplement the one(s) from your book. Wait until you have a better grasp on studying first though. You don't want to "waste" those questions by looking at them before you know the basics.
 
Richard Newman
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For example:
Consider the following class...

What will be printed?
I wasn't aware that Object can accept String values? Things like this weren't really expressed in any of the books or tutorial vids I watched. I assume that trying to pass a String into that code is bad form?



Another example:
Identify the exceptions that are usually thrown by the JVM and the exceptions usually
thrown by an application.
D. JVM : ClassCastException, NullPointerException, SecurityException
Application : IllegalStateException, IllegalArgumentException

Doesn't a question like this imply deep knowledge of Java? Exceptions were "covered" by the books and tutorials, but not in this kind of depth? I understand exceptions and I actually thought that I could make a program and use exceptions correctly, but I didn't know I needed to go memorize which exceptions are not only runtime exceptions, but which runtime exceptions applications handle and which they don't handle???

Is there anyone who had success on the exam that can recommend which books or tutorial series to go through?

The thing is, I feel like I could write a program. It may not be the most perfect or beautiful program ever, but I understand the fundamentals. But I do not feel like, after doing some exam practice questions, that I have been studying the right stuff???
 
Richard Newman
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne Boyarsky wrote:Welcome to CodeRanch!

Yes, the exam shows you some examples of horrible code. I haven't read that book, but I just looked at the sample questions in the preview. Except for the one asking for the state of two variables at each line, the first few all looked reasonable.

Have you read a book on Java other than a study guide? If so, I recommend you put down the study guide and start with that. Head First Java, Thinking in Java, Core Java, Deitel & Deitel, etc. Any of these are good choices to start out with. Once you know the fundamentals, you can use the study guide for its intended purpose. To get you ready to see the details you'll need to pass the exam. Trial and error coding won't be enough to pass the exam.

Also, there are mock exams you can buy to supplement the one(s) from your book. Wait until you have a better grasp on studying first though. You don't want to "waste" those questions by looking at them before you know the basics.


I have done the entire "Cave of Programming" beginners course. I have also watched a few other tutorial courses. I have read Oracle Certified Associate, Java SE 7 Programmer Study Guide by Reese. I read one other book which I can't seem to find on my tablet now (might have lost it recently).

I will see if I can nab those books off Amazon and give them a go.
 
Richard Newman
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consider the following code appearing in Eagle.java


What needs to be done to make this code compile?
D. Make Bird constructor public:
public Bird() { ... }



Why do you even need the Bird constructor or class? It's empty and I don't see how any part of the main method calls it (or any part of Eagle calling it). So what difference does it make to that code. Couldn't you just get rid of that Bird class altogether and have a functional program? I also don't understand why the "new Eagle("Bald Eagle").name" portion is used? What does that actually do? Does it display "Bald Eagle" and then assign that to the name variable of the Eagle class like I'm thinking?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65340
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Richard Newman wrote:Couldn't you just get rid of that Bird class altogether and have a functional program?

That's irrelevant. The questions isn't about optimizing the class but getting it to compile.

This is what Jeanne recommended against trying to use exam questions to learn Java. They are not a good way to learn anything. Their purpose is to see if you already understand the concepts.

Use one of the books Jeanne recommended.

I also don't understand why the "new Eagle("Bald Eagle").name" portion is used? What does that actually do? Does it display "Bald Eagle" and then assign that to the name variable of the Eagle class like I'm thinking?

Other way around. Construction happens first.
 
Richard Newman
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:
Richard Newman wrote:Couldn't you just get rid of that Bird class altogether and have a functional program?

That's irrelevant. The questions isn't about optimizing the class but getting it to compile.

This is what Jeanne recommended against trying to use exam questions to learn Java. They are not a good way to learn anything. Their purpose is to see if you already understand the concepts.

Use one of the books Jeanne recommended.

I also don't understand why the "new Eagle("Bald Eagle").name" portion is used? What does that actually do? Does it display "Bald Eagle" and then assign that to the name variable of the Eagle class like I'm thinking?

Other way around. Construction happens first.


In all honesty, I should have written that better. But thank you for the correction. I guess my big problem is going to be that my brain functions all the time in "optimization mode". If something has no purpose, I don't understand why it's there. I'm assuming it's VERY bad form to do what that question did then right? I will look into those books (actually already bought one and now I'll wait for it to get it to me).

And a huge thank you to Bear Bibeault as I had no clue how to get it to display right (I tried to manually format it and the spaces got taken out. XD).
 
Winston Gutkowski
Bartender
Pie
Posts: 10571
64
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Richard Newman wrote:I guess my big problem is going to be that my brain functions all the time in "optimization mode". If something has no purpose, I don't understand why it's there.

Which is actually not optimization at all, but normalization; and in most cases, it's not a bad thing at all.

However, if taken to extremes, it can lead to code that's hard to read and debug. For example: if you write great chains of method calls simply to stop yourself declaring an interim variable to hold a result, you often end up shooting yourself in the foot.
It's very much an individual choice, but I rarely put more than two "dots" in a row in my code unless I've specifically designed a class as a "fluent interface" (you might want to look it up).

You might also want to read this article.

HIH

Winston
 
Mike. J. Thompson
Bartender
Posts: 689
17
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its true that the Bird class in your example has no useful function, but the point of it is not to be good code. It's only purpose is to test your understanding (in this case your understanding about what happens when a constructor is called).

I agree with what others have said. Those questions alone will not help you learn java.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Richard Newman,

First of all, a warm welcome to CodeRanch!

Richard Newman wrote:Is there anyone who had success on the exam that can recommend which books or tutorial series to go through?

I have passed a few certifications until this moment and I always used the appropriate K&B study guide. So for OCAJP7 you'll need K&B7. You can find an overview of all available resources in this topic (in the 1st post). These books (study guides) will not teach you Java! These study guides thoroughly prepare you for the exam. When I took my first certification, I already had studied Java at school and had 1 year experience as a Java developer. So you'll probably (as already suggested by Jeanne) need to go through a Java book first, before you start preparing yourself for the exam using a study guide.

Richard Newman wrote:I wasn't aware that Object can accept String values? Things like this weren't really expressed in any of the books or tutorial vids I watched. I assume that trying to pass a String into that code is bad form?

So none of these books/videos have shown code likeorIf that's the case, these books/videos are (in my opinion) pretty worthless. Because that's an illustration of one of the basic concepts of an OO language like Java: the IS-A relationship and inheritance. And if I add a few methods in the Animal class and they are overridden in a subclass, you would be a witness of polymorphism.

Richard Newman wrote:Why do you even need the Bird constructor or class? It's empty and I don't see how any part of the main method calls it (or any part of Eagle calling it). So what difference does it make to that code. Couldn't you just get rid of that Bird class altogether and have a functional program? I also don't understand why the "new Eagle("Bald Eagle").name" portion is used? What does that actually do? Does it display "Bald Eagle" and then assign that to the name variable of the Eagle class like I'm thinking?

The OCA exams are not at all about your ability to write nice, clean, elegant code (you'll have the OCMJD certification for that). The purpose of the OCA exams is to prove you'll have a (very) good/solid understanding about Java and OO basics. That's why the code snippets are sometimes a little bit obscure or have seemingly useless statements. This Bird/Eagle example test your knowledge about constructors: when a subclass is instantiated, the constructor of the parent classes are always (even if it seems there's no statement invoking the parent constructor) invoked as well (and if the constructor isn't accessible, a compiler error is given). Some of the questions will be just about memorization (like the different exceptions and when they are usually thrown).
Don't forget you'll need to answer 70 questions in 120 minutes, so you have a limited time for each question. So if you'll get completely implemented Bird and Eagle classes with for example 100 lines of code each, you'll definitely complain you don't have enough time to evaluate the code and answer the question, you had to scroll a gazillion times on the exam because not all code fitted on the screen,...

Richard Newman wrote:Are the exam questions really as obscure and nasty as I'm seeing in this question book by Hanumant Deshmukh?

Hanumant Deshmukh is the eBook version of Enthuware's simulator JA+ V7 for OCA-JP 7 Certification. And Enthuware provides by far the best mock exams for the OCA exams. So yes, the questions on the actual exam will be as obscore and nasty as the ones in that question book.

Hope it helps!
Kind regards,
Roel
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Richard Reese's cert book has poor reviews on Amazon. I've liked some of his other books, so maybe it was poorly edited. Or not really a cert book and billed as one.

I think you should get the K&B 7 book or Mala Gupta's OCA book. If you don't plan to take the OCP afterwards, you might want a OCA only book. Lighter to carry around and all!
 
Guillermo Ishi
Ranch Hand
Posts: 789
C++ Linux Python
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All of your examples are typical of the test. You might know enough java to answer the bird constructor needs to be visible if someone asked you directly, but the way this knowledge is tested for in the test you might not NOTICE it isn't visible! You will also encounter nested loops with strange conditional tests and you will have to unravel those, with a time constraint. I guess it's all valid for a professional certification. Anyway, first pass is learning java, second pass get enthuware and learn the peculiarities of the test.
 
Richard Newman
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you all VERY MUCH for the insight!

I did buy the Mala book. I haven't read it yet but it's on my now much longer to do list. XD
I'm reading another book (that got fantastic reviews) with lots of pictures and goofy stuff that supposedly helps you learn (and having a background with psychology I can see why).

I will go over a few more books, then give these test questions another go and see how it goes.

One huge question I've had...how do you get a job programming (prior to having the cert) or even really solid practice programming? People say to just "make programs" but that's very broad and open ended. I almost don't know where to start with such a broad statement.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Richard Newman wrote:One huge question I've had...how do you get a job programming (prior to having the cert) or even really solid practice programming? People say to just "make programs" but that's very broad and open ended. I almost don't know where to start with such a broad statement.

From my own personal experience. When I finished school (graduated in Applied Informatics) I was able to get a VB/Java programmer job based on my education and the internship I did (which was a part of that education). Here in Belgium there is something like a "first job constract" which is specifically for young people who have just finished school. A company needs to have a certain percentage of employees with such contracts and a company gets some benefits for every young employee with such a contract. I was able to start my first job thanks to such a contract.

Here you'll find different opinions about things you could/should do to improve your chances to get a programming job. It's mainly about the USA, so don't know if that's really relevant for you.
 
Guillermo Ishi
Ranch Hand
Posts: 789
C++ Linux Python
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Richard Newman wrote:
One huge question I've had...how do you get a job programming (prior to having the cert) or even really solid practice programming? People say to just "make programs" but that's very broad and open ended. I almost don't know where to start with such a broad statement.


What is the book with the pictures and goofy stuff? Sounds different.

As for what to do...what interests you? I think java is used for web back ends, most commonly. On Udacity there's a class you can go through for free called "Web Development" which is taught by the main guy who was behind Reddit. It's very interesting. Unfortuanately it uses Python rather than Java. But the principles are the same. The course uses the Google App Engine and there is a Java version of that as well as Python. You could probably go through the course using Java instead of Python. There is another class that does the same thing using RonR, but nothing for Java that I've noticed. Also, the GAE has a Java quickstart thing that you could go through. GAE is only kind of semi-standard, but Udacity itself runs on it. Got to start somewhere.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guillermo Ishi wrote:
Richard Newman wrote:
One huge question I've had...how do you get a job programming (prior to having the cert) or even really solid practice programming? People say to just "make programs" but that's very broad and open ended. I almost don't know where to start with such a broad statement.


What is the book with the pictures and goofy stuff? Sounds different.

Sounds like the Head First series. So probably Head First Java. I myself have Design Patterns and Servlets & JSP. I like them both a lot!
 
Richard Newman
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guillermo Ishi wrote:
Richard Newman wrote:
One huge question I've had...how do you get a job programming (prior to having the cert) or even really solid practice programming? People say to just "make programs" but that's very broad and open ended. I almost don't know where to start with such a broad statement.


What is the book with the pictures and goofy stuff? Sounds different.

As for what to do...what interests you? I think java is used for web back ends, most commonly. On Udacity there's a class you can go through for free called "Web Development" which is taught by the main guy who was behind Reddit. It's very interesting. Unfortuanately it uses Python rather than Java. But the principles are the same. The course uses the Google App Engine and there is a Java version of that as well as Python. You could probably go through the course using Java instead of Python. There is another class that does the same thing using RonR, but nothing for Java that I've noticed. Also, the GAE has a Java quickstart thing that you could go through. GAE is only kind of semi-standard, but Udacity itself runs on it. Got to start somewhere.


The post right below yours (and above mine) is correct. It's called Head First Java as recommended by someone in this thread already.
In fact, the Mala Gupta book that someone recommended also says to give that book a read before using the Mala Gupta book! Haha!

I'll look into Udacity and the free course. I know I need to start somewhere, but finding the companies out there that allow fresh starts seems like finding a needle in a haystack right now. This is basically a complete life change for me. I have an MBA, which did nothing for me in my previous line of work. I'm hoping that some company will at least consider the fact that I'm dedicated and hard working and give me a chance at an entry level position and let me work my way up. But I gotta learn Java and be GOOD with it! Which is why I want to get as much practice as I can, but I'm not sure where exactly to get practice at other than at a job...and thus a vicious looking cycle is forming in my mind...
 
Guillermo Ishi
Ranch Hand
Posts: 789
C++ Linux Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Richard Newman wrote:I'm hoping that some company will at least consider the fact that I'm dedicated and hard working and give me a chance at an entry level position and let me work my way up. But I gotta learn Java and be GOOD with it! Which is why I want to get as much practice as I can, but I'm not sure where exactly to get practice at other than at a job...and thus a vicious looking cycle is forming in my mind...


Why are you switching horses? I do think the MBA will help you get a programming job.

I also came into it sort of sideways. My story, briefly. I was a music student at a university. "Home computers" were new and the second I discovered them I lost all interest in anything except them. I built a z-80 computer of my own design using free sampled chips. I built an eeprom programmer to program its eeprom. Next, the uni opened a small microcomputer lab with limited hours that I would use a lot. If it wasn't open I would go to the library and reboot the card catalog on my floppy disk and run my C compiler on it Sometime around then I got my own xt computer. I got a job at a place that put computers together, in those days there were a lot of mini-dells and mini-gateways that put together systems locally. I got bored there because I liked programming, not a boss going hurry, hurry. A salesman there told me about a place he had visited that I should try to get a job at. So I went there and got a job, making $5 an hour. It was the '80s but still.... It was an ex-ibm'er doing microcontroller stuff. I wrote a PC interface to an eprom programmer for him. I wrote an IDE for board with a basic interpreter on board. Lots of other stuff like remote control vending machines and powerline modems. But at that low wage I couldn't make it so I quit and worked in factories some. It was not silicon valley, it was the depressed south. My Mom saw an ad in the paper and I interviewed there. It was a group of ibm'ers doing something really interesting. The guy I interviewed with knew the first guy I worked for and knew another guy who worked there who he thought was really brilliant, so I had power by association Also, the ad was placed by a firm, but the owner of the firm was best friends with the guy I interviewed with. He gave me lots of tips like go to the library and research the company. So during the interview I was able to drop product names and stuff. The guy i interviewed with had a similar background to mine, an engineer "without portfolio", no degree, although he had been a full engineer and engineering manager at IBM. I guess that was possible back in his day. There was one opening and two finalists or two applicants but they decided to hire both of us, me and an electrical engineer with a programming interest. So I got that job and started at about 5x the average local wage. The theory being "we pay people a lot, so that they will stay". I was really good and I was my manager's "superprogrammer". I saved lots of engineers from a bawling out by tweaking code to compensate for their mistakes. I was popular I did that for 10 yrs still living like a student the whole time and saved everything. So, from then on it's only been my ability to convince people that I can do what they need me to do. I never have experience with exactly what they need, but they figure I can work it out. I have no degree in anything. Everything in programming and the like has been self-education. I guess if you're not going into it the normal way, hustling (in the good sense) is the name of the game.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guillermo Ishi wrote:He gave me lots of tips like go to the library and research the company. So during the interview I was able to drop product names and stuff.

That's something I always have done and still do: when I go on an interview, I always research the company a little bit. And these days it's much easier: you just browse the company's website for 5-10 minutes and you are good to go
 
Guillermo Ishi
Ranch Hand
Posts: 789
C++ Linux Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roel De Nijs wrote:And these days it's much easier: you just browse the company's website for 5-10 minutes and you are good to go

The library had a section that was clippings and/or indexes into articles about local business. I can't remember exactly what form it was in. The thought of the recruiter was essentially research deeper than your competition. So I guess the modern equivalent is spend 10-20 min. on the company's site instead of 5-10.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic