Tuesday, June 26, 2012

Comparison BetweenTwo Dates


Monday, June 11, 2012

Select Option Ops

<html>
<body>

<select id="slct" onchange="slct();">
  <option value="1">Volvo</option>
  <option value="2">Saab</option>
  <option value="3">Mercedes</option>
  <option value="4">Audi</option>
</select>

<script>
function slct(){

    var selObj = document.getElementById('slct');
    var selIndex = selObj.selectedIndex;

    alert(selIndex);
    alert(selObj.options[selIndex].value);
    alert(selObj.options[selIndex].text);
}
</script>


</body>
</html>

Tuesday, May 22, 2012

Codelets

#Convert String to Date in Java


java.util.Date = java.text.DateFormat.getDateInstance().parse(date String);
or


SimpleDateFormat format = new SimpleDateFormat( "dd.MM.yyyy" );
Date date = format.parse( myString );

Saturday, March 3, 2012

Read File In JAVA


import java.io.*;

class ReadFile{

    public static void main(String args[]) {
        try {

            FileInputStream fstream = new FileInputStream("c:/yash.txt");

            DataInputStream disobj = new DataInputStream(fstream);

            BufferedReader br = new BufferedReader(new InputStreamReader(disobj));

            String frst = br.readLine();
            String scnd = br.readLine();
            if (frst != null) {
                System.out.println(frst);
                System.out.println(scnd);
            }
            else{
                System.out.println("empty");
            }
            disobj.close();

        }
        catch (Exception ex) {
            System.out.println(ex.getMessage());
        }

    }
}

Sunday, February 19, 2012

In The Spring 3.0

Introduction-


To be very honest i am not some die hard geek coder or some sort of JAVA Guru writing some Bible. I am just a beginner who just started learning to work in JAVA but i am trying to note all the points i am covering while learning Spring 3.0. Just hoping, may be it will also help you. Have fun. :-)