Print to console without using semi colon

One of my friend asked : “How can one write to console without using semi colon in Java ?”.
I tried many work-arounds . Even Googling did net help much .

I thought i should raise an exception some how thats it some thing will be written on the console. Naa , its did not work well.

Then a stupid workaround was to enable the verbose argument , thats it every class loaded in the JVM is traces on console.

The some how i tried real tricks to print my name on console ,

This is what i got,


public class Test {

 public static void main(String a[]){

 if ( System.out.append("jasdeep") instanceof Object ){

               }
         }
  }

You might be wondering , why i did not use System.out.println() . Because it does not return anything , So it can not be compared in if block.

Advertisements

6 thoughts on “Print to console without using semi colon

  1. I know this if off topic but I’m looking into starting my own blog and was curious what all is required to get set up? I’m assuming having a blog like yours would cost a pretty
    penny? I’m not very web savvy so I’m not 100% positive. Any tips or advice would be greatly appreciated. Appreciate it

    1. Rolland,
      On the contrary, Having a blog like mine would not cost you a single penny.
      just go to wordpress.com, Sign up and start writing your posts.
      It’s just like email, just that your ever email is public.

      Regards,
      Jasdeep

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s