Categories
Android Continuous Integration Java Maven

Automating android application signing and zipaligning with maven

This is something that has had me tearing my hair out for a few days now, I was pretty much border-line braveheart-ing my screen…. I’ve recently been on a little drive to try to maven-ize my projects. All had been going well until I needed to sign and zipalign my APKs. This post will help […]

Categories
Certification Java Programming SCJP

String concatenation operator

The string concatenation operator is a bit like a hedgehog, it looks cute and sweet, but try to grab hold of it quickly and you’ll soon know about it… It’s actually quite simple, however there are some traps that are very easily overlooked (just got caught out with it on a mock test, so I’m […]

Categories
Certification Java Programming SCJP

The instanceof Operator

The instanceof operator is a great way for checking if a reference variable is of a given type, in other words, does it pass the IS-A inheritance test. Ask yourself, is a Cat a Dog? A Dog a Cat? Or is a Cat an Animal and a Dog an Animal? In true Harry Hill style, […]

Categories
Certification Java Programming SCJP

Compound Assignment Operators

There are various compound assignment operators, however it is only necessary to know the 4 basic compound assignment operators for the exam, being as follows: += (Addition compound) -= (Subtraction compound) *= (Multiplication compound) /= (Division compound) Essentially, they’re just a lazy way for developers to cut down on a few key strokes when typing […]

Categories
Certification Java Programming SCJP

Static members…

Statics are a rather strange beast, they belong to no instance of a class, they have no fixed abode, other than their class.. Consider the following example : Statics don’t belong to any instance, they belong to the class itself. So there is only ever one copy of a static member (method or variable). Statics […]

Categories
Certification Java Programming SCJP

Local Variables, as far as the SCJP is concerned

Local variables are variables that are declared locally, funny that eh? This one should be nice and easy, lets have a look at a quick example : Some really easy things to remember, local variables don’t ever get initialised automatically, so you have to do that yourself. The method above, doSomethingElse, the variable gets declared, […]

Categories
Certification Java Programming SCJP

Other modifiers, for members…

We’ve already touched upon various modifiers, for classes (both access and non-access), but there are also some more modifiers for members, as detailed here. We have the following modifiers for members : final – Can’t be overridden abstract – No implementation specified, subclass must implement synchronized – Only a single thread of execution can pass […]

Categories
Certification Java Programming SCJP

Class Modifiers (non-access)

In addition to class access modifiers, classes can also be marked with non-access modifiers. These modifiers imply rules on a class, but are not necessarily linked to access rights. The following non-access modifiers are available: final – The class can’t be extended. abstract – The class has to be extended, and can’t be instantiated on […]

Categories
Certification Java Programming SCJP

Class Access Modifiers

Class access modifiers define who can see the class, you use it on a daily basis, have a look at the following : There you go, you said “public class”, thats you saying that this class is public, and anything can access it. It is important to note, that even though a class may be […]

Categories
Certification Java OO Concepts Programming SCJP

Coupling and Cohesion, what you need to know for SCJP…

Coupling and cohesion are two terms that often get mixed up, however they are actually really simple concepts, and the bonus is, they don’t just apply to Java. Coupling Coupling, in its purest terms, means “the degree to which one class knows about another class”. If one class uses another class, that is coupling. Coupling […]