Well it would be easy to have a third course that issues the certificate for both.
This is what I would do- student enrolls in course one upon completion they get a plain jane cert which includes the key to course 2. When they complete course 2 the get a key to course 3. Course 3 has a title that includes both previous course names and all it does is issue their certificate. There are no restrictions on the certificate in course 3
class 1- basic java programing (cert generates based on a pass grade, no borfer no sig but in custom text the key to next class)
class 2- advanced java programing (cert generates based on a pass grade, no borfer no sig but in custom text the key to next class)
class 3 Basic & Advanced Java Programing (nice certificate border watermark, seal, sig the whole deal) The only thing in the class is the instructions to generate thier certificate. It is also a nice place to have an exit survey.