That’s a fairly typical request, from either internal development teams advertising for new starters, or from clients to consultants when they want to onboard a new member of a team.
I resolved to fix this and decided to learn as much Java as I needed to start understanding the server codebase, and to contribute (slightly!) to the changes needed as the application we were building evolved. I’ve been looking at (and contributing to) the Java codebase now for just over six weeks on the current application I’m building. I’m by no means a Java wizard yet, but I’m making good progress and can now contribute effectively to the whole stack that our team is working on.
If we look at an example, we will quickly grasp what a “type” is!
In Java if you define a string as:
String myString = "Java is great!"; // OK
Then everything works correctly, as the type of myString is correctly identified as a String type, which it was originally defined as.
However, were we to declare
Boolean myString = "Java is great!"; // Compiler error!
Then we will end up with a problem, and the compilation would fail. We have explicitly made myString to be a Boolean type but have then defined it to be a String type.
Types in themselves can be complex. A language with static types – like Java – is referred to as a statically-typed language and checks the types at compile time, such as our example above. On the other hand, a language with dynamic types is referred to as a dynamically-typed language, and – crucially – checks the types at runtime.
which will, at runtime, determine that myString is a String type. One of the biggest bugbears of statically-typed language developers is that the following is perfectly valid (if terribly designed) code, which wouldn’t break at runtime or compile time.
Learn to love streaming
myAwesomeList.stream() .filter(entry -> entry.contains("Java") .findFirst() .ifPresent(entry -> system.Print(entry.toUpperCase() + "is a statically typed language!"); // JAVA is a statically typed language
Notice how similar those are? I accept there are some small differences but generally there is a lot of overlap. A lot more than most people would expect! All made possible by the power of Stream()!
Get your IDE set up correctly
Don’t be afraid to ask an expert!