>

Wednesday, August 29, 2012

Java program to get Environment variables

public class getSystemProperties {

    public static void main(String[] args) {
 

        String os=System.getProperty("os.name");
        System.out.println("Current OS Name: "+os);
 

        String home=System.getProperty("user.home");
        System.out.println("Home directory of Current user : "+home);
 

        String version=System.getProperty("os.version");
        System.out.println("Versio of OS: "+ version);
 

        String arch=System.getProperty("os.arch");
        System.out.println("Architecture of OS: "+ arch);
 

        String jver=System.getProperty("java.version");
        System.out.println("Java Version: "+jver);



        String uname=System.getProperty("user.name");
        System.out.println(uname);
       
    }
}

SImple Thread Program To Pause For Loop

class ThreadExample{
  public static void main(String args[])
   {
        Thread th=new Thread();
      try{
          for(int i=0;i<10;i++)
    {
                System.out.println(" Value "+i);
     th.sleep(2000);
              }
          }
           catch(Exception e)
    {
     System.out.println(" "+e.getMessage());
    }
    }
         }

Java Program To Open Default Browser

import java.awt.Desktop;
import java.net.*;
  class DesktopTools{
    public static void main(String args[])
      {
    try{
         URI u=URI.create("www.google.com");
         Desktop ds=Desktop.getDesktop();
         ds.browse(u);
         }catch(Exception e)
                  {
                    System.out.println(" "+ e);
        }

     }
 }



It Will open your default browser and redirect you to google Page. It is user defined if you want to change the website address it will works fine.
         

Wednesday, March 7, 2012

Tuesday, March 6, 2012

Dont Visit This Websites If you are Non ComputerScience Dude

Addicted to a website? Wanting to cut down on your visits? then just click
Stop Addiction Of Websites

Don't want to give them your real email? Use a temporary email. No registration, No Form filling... Just send ur email and delete your Email ID:

Hope you will enjoyed it..

Windows 8 Consumer Preview

Hai Dudes,  Interested in experience the new microsoft OS. Windows 8 Consumer preview is officially released by Microsoft Corp.. To grab this just click
Windows 8IGHT Consumer Preview

Sign up for getting Science SMS on your Mobile

Hai to Everyone... Are you interested in learning new things .. If so it is the right website for u..
Just navigate to the following and register ur mobile with them.. You will get daily science facts to your mobile directly....
http://scienceatmobile.ignou.ac.in/Registration.aspx