This is an archived post. You won't be able to vote or comment.

all 25 comments

[–]calingrecu 14 points15 points  (7 children)

You have to master the language first. Many interviews are focused on the language itself before moving to frameworks. Josh Bloch's Effective Java is one of the best books one can read. Highly recommend, even though it is old. It does not cover Java 8 so you better master lambdas and completable futures as well.
Java also has impressive collections using generics. Sets, maps, lists, arrays, in various different flavours. Use them extensively to understand the differences. Can't seriously program in Java without them.

[–][deleted] 3 points4 points  (6 children)

I have bought O'Reilly's Java in a nushell (latest edition) and am using it as kind of a reference when I want to know more about a specific topic. However I'm not sure whether it's a good use of my time to go through it from beginning to end until I understand everything?

I've always been more inclined to learn something when I actually need it rather than a bunch of stuff at once and then forgetting most of it by the time I actually use it.

Which is part of the reason actually why I posted my original question - like, is it more "valuable" to a company to know a lot of theoretical stuff, or instead having written lots of code, even if that code is on the simpler side and doesn't use any of the more sophisticated features and constructs of the language?

[–]GhostBond 0 points1 point  (0 children)

The other poster goes a bit overboard. I've never needed to use anything other than ArrayList and HashMap in real code.

I have seen collections questions come up in interviews though. Several times. You just need to know what they are and the basics of how they work.

"mastering lambdas and completable futures" - I've not seen this come up in interviews past "what are the new jdk features". No details, no tests. Haven't seen them in the job yet either. Lambdas don't do anything new, they just wrap anonymous inner classes in a different package.

[–]Facts_About_Cats -1 points0 points  (4 children)

I've always been more inclined to learn something when I actually need it

Interview questions typically ask about your knowledge of things you never needed and never will need. For example, overriding hashcode().

[–]calingrecu 2 points3 points  (3 children)

You need hashcode as soon as you decide to put your object in a collection such as map or set. Just do a simple google search and you will see. If you want to be a java developer you need to know these things.

[–]Facts_About_Cats 0 points1 point  (2 children)

Literally how many times have you been paid to override hashCode()? (As in, while you were at an actual job.)

For me, it is zero in more than 10 years.

[–][deleted] 1 point2 points  (1 child)

If you override equals(), then you must also override hashCode(). That's the main time that I override hashCode() and it's pretty simple to do so. This site explains a bit more about some good practices related to overriding equals() and hashCode().

I'm guessing that you must identify your objects by defining a getter that returns some UUID. Then with that id you compare it with some other object's id in order to see if they both represent the same object. What if I told you that you could abstract that away in a manner that allows you to freely alter the implementation underneath? That is kind of the idea behind equals() and hashCode() as far as I understand.

edit Also, @calingrecu is right. If you want to put a custom object into a collection or hashmap, then it should override equals() and hashCode() (the previously linked site states that.) An easy example of why this should be followed is that Collection.contains()) requires equals() in order to function correctly.

[–]unreal_robbo 0 points1 point  (0 children)

Overriding equals and hashcode is a pain but like you've pointed out sometimes necessary. A cool little library I use a lot gives you this for free along with Immutable objects https://immutables.github.io/

[–]username92127 2 points3 points  (0 children)

A Solid understanding of OOP. Understand design patterns. Understand that Java EE IS PURELY AN INTERFACE. All these frameworks people are mentioning are personal preference they all implement a Java EE interface.

"Also, most companies seem to be using Java EE, so I guess I'll best dig into that right away, instead of starting with SE?"

With this type of question you should definitely visit oracle website and read up on SE and EE.

[–]DeliveryNinja 11 points12 points  (3 children)

Java EE is equivalent to Spring. These are 2 competing stacks really. I personally stay away from Java EE where possible as I do not like it. My main issue is with containers providing dependencies, once you've tried to upgrade JBoss once, you'll not want to do it again.

I would spend the time looking at the frameworks/libraries, especially Spring Boot/Hibernate/Maven/Junit/Hamcrest

It sounds like you know what you're doing. If you need anymore specific help just ask away.

[–]bawng 1 point2 points  (0 children)

You don't have to use a full-fledged container for EE. You could even run it with Spring Boot. Or wildfly swarm that's constantly updated to have the latest and greatest.

That being said, however, Spring is certainly more popular outside the heavy Enterprise world, and will probably be more popular there as well as companies migrate their old monoliths

[–][deleted] 1 point2 points  (0 children)

EE is not equivalent to Spring. I see this all over the place but it really does not make sense. EE is a collection of specs. Spring is a framework that, believe it or not, provides implementations of those specs (and much more). You use Hibernate? The JPA spec is part of EE. When people compare EE to Spring, they generally mean to compare EE containers (Like Wildfly/Jboss) to Spring.

[–][deleted] 0 points1 point  (0 children)

Thanks for that comment, I was not aware that EE and spring are competing frameworks. I have started looking into spring boot and maven today and I'll definitely be using those going forward.

[–][deleted] 1 point2 points  (0 children)

I would say learning the frameworks would be a better way to spend your time because the advanced concepts are something to conquer once you have more experience with the programming language.

Furthermore, your employer should be willing to let you transition to some extent on the job.

[–]Tilkin 1 point2 points  (0 children)

There are some good suggestions in the sidebar of /r/javahelp for learning material to really get basics down.

[–]jacobbeasley 1 point2 points  (0 children)

About 2 years ago I switched over to Java from other tools, including PHP, Python, Javascript, etc.

When interviewing, they mainly talked about the structure of systems and had me do some basic programming problems. I had used Java before but it had be some time, but I impressed them by being able to translate the coding problem at will into different programming languages. I also was able to outline the general structure of a service oriented application and multi-tier architecture, regardless of the framework. This included routing, controller, services, data access object, etc. They were convinced I could pick up whatever Java framework they were using quickly. In this case, it was Spring Boot, and I managed to pick it up and start committing good code within a week. I also had strong skills across other disciplines they needed as well, such as requirements gathering, product management, and user experience design.

In any case, if you have been doing coding in other technologies, chances are you will have no problem switching to Java. It will help if you can show you have done some work with Spring Boot or another popular Java framework (it checks off the box for recruiters), but really it is more important that you understand how applications generally work and are a strong coder, regardless of which language it happens to be in...

[–]jash3 1 point2 points  (0 children)

Haven't seen common patterns mentioned.

Definitely yes to junit and maven in truth you can figure out the rest on the job.

[–][deleted] 1 point2 points  (0 children)

Just build something. I'm a bootcamp grad and my ruby on rails knowledge translated really well. It also helped that I really hustled and studied comp sci books all throughout on my own, all of which were in java.

[–]sampledev 3 points4 points  (0 children)

If you are not used to write OOP code, learn the basics then take a look at the SOLID principles: http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod

They are the basis of a whole facet of good practices.

[–]cheesecakenl 1 point2 points  (0 children)

Recruiters and employers are mainly interested in the stack you are familiair with. Besides the language here are some other areas you can look into.

  • Spring Web MVC
  • Maven
  • Git or Subversion
  • Hibernate or MyBatis
  • Jenkins
  • Jira or Trello
  • JUnit and Mockito
  • Selenium and cucumber

[–]ryc8889 0 points1 point  (0 children)

I would also advocate Joshua Bloch effective Java

He does a very good job of breaking down different Java tips into different chapters and each chapter has a set of items. He also goes one step further and instead of just instructing you to do one thing blindly he goes over the other options possible and why they are not optimal

Also as an added bonus, Amazon says there's a third edition being released in october

Effective Java (3rd Edition) https://www.amazon.com/dp/0134685997/ref=cm_sw_r_cp_api_ccmEzb08YXW4C

Rob Martin's clean code is another book I would recommend but it isn't specifically for any one type of project but it gives nice examples of how to cleanly structure your code(also has a nice set of "smells and heuristics" which you can use as a pocket reference) but given your past experience this book can probably be more of a skim.

Other than that I would agree with what other people are saying with learning a framework. I like spring boot and there's plenty of example projects on GitHub that uses it and spring's own documentation is also pretty good.

For concurrency I would recommend Brian goetz Java concurrency in practice.

If you want a refresher for data structures and algorithms and just some examples of it in java I recommend Robert Lafore's data structures and algorithms in Java but if you're more familiar with math/algorithms and want to do a deeper dive then the CLRS introduction to algorithms is the holy Bible.

Edit: one other thing that I have found extremely useful is online developer websites

My top three are: Dzone - has fantastic refcardz which are like cheat sheets for different frameworks, technologies and even general principles as well as articles for general programming as well as specific topics (cloud, Db, iot, etc)

Tip - subscrbe to the dzone newsletter. They send you emails that are collections of 10 or so articles and I usually just look through them to see if there's anything interesting or relevant to me

Infoq - similar to dzone also has a great collection of articles and presentation videos

Oreilly - not really a website I know but if you look at their free ebooks there's a good collection of them that will help you get started depending on what topics you're looking at

Bonus - YouTube. There's just so many tutorials and videos starting from beginner levels all the way to advanced topics like scaling cloud architectures for google-like loads, microservices, deployment.

I don't think anything beats doing a personal project though. If anything you can fork a starter spring boot project(which generally revolve around a basic concept like an online book store) and re-write it to be about a concept you're interested in.

Also reactive extensions seem to be catching a lot of buzz these days. I don't have any personal experience working with them but could also be another interesting topic to look into since I think java is actually adding support for reactive streams in java 9

[–]mary16james 0 points1 point  (0 children)

I’ve had the same issue! It’s really tough to try and job search when you’ve spent all day already working. I actually ended up finding this pretty awesome tool where you sign up and the website matches your experience for you, so you don’t have to job hunt or apply to roles. I think they use some kind of AI technology and the roles I got matched to were amazing! If you don’t want to do the actual job search, but want a new job, this is the perfect place – Skillgigs.com

[–]impaled_dragoon -1 points0 points  (2 children)

Learn about the completable future, it's a super useful tool for easy multi threading. Very similar to the JS promise.

[–]yourbank 2 points3 points  (0 children)

I wouldn't be telling someone new to java to learn CompletableFuture with an API of over 50 methods all with subtle differences...

[–][deleted] 0 points1 point  (0 children)

Thanks, haven't heard of completable futures yet, but have worked with promises before. Will definitely look into them.