I may be wrong, but "Zen Coding" is meant to be more useful for languages where you have a high level of nested elements in a structure (LISP, anyone?!).
As a simple case of HTML, you may have an example as follows:
<div id="page">
<div class="logo"></div>
<ul id="navigation">
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
</ul>
Using the concept of Zen Coding, this can be shortened to something as follows:
div#page>div.logo+ul#navigation>li*5>a
This allows you to type much less code, but have it automatically expand your string of text into an editable code block, so that you don't need to go through the process of additional brackets, tags, etc., in order to get the expected output.
In the case of Java, for example, your code should be much less nested, and more "flat", using classes, methods, etc., in order to achieve the same result. Example, if you have a block of Java code that looks like this:
public static void main() {
private int x = 1;
while (x < 10) {
if (x < 5) {
for (int i = 0; i < 100; i++) {
switch(i) {
case 1: //Do Stuff here
case 2: //Do more stuff
default: //Do more complex nested stuff here
}
}
}
x++;
}
}
You should look at restructuring the above code into a much more managable, less nested block of code, rather than trying to shorten up the typing of the code by attempting to do some shorthand like:
public/static/void/main>while(x<10)>if(X<5)>for(new(i[0..100]))>switch[1/2/Default]