Saturday 14 July 2018

hyperlink in HTML

<!DOCTYPE html>
<html>
<body>

<h2>hyperlink in  HTML </h2>
<p><a href="http://localhost:8080/addCarDetails">Visit our AddCarDetails</a></p>

</body>
</html>

How to Check whether number is even or odd

import java.text.ParseException;

public class TestOddEvenExample {
    public static void main(String args[]) throws ParseException {

        int x = 24;
        oddEvenChecker(x);

        int xx = 3;
        oddEvenChecker(xx);
    }

    static void oddEvenChecker(int x) {
        if (x % 2 == 0)
            System.out.println("You entered an even number." + x);
        else
            System.out.println("You entered an odd number." + x);
    }
}


Friday 13 July 2018

simple date format in java

simple date format in java example for bellow date format

yyyy-MM-dd HH:mm:ss.SSSSSS.

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

//TODO OutPut should LIKE in this format yyyy-MM-dd HH:mm:ss.SSSSSS.
public class TestDateExample {

public static void main(String args[]) throws ParseException {

SimpleDateFormat changeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSSSS");

java.util.Date temp = changeFormat.parse("2012-07-10 14:58:00.000000");
Date thisDate = changeFormat.parse("2012-07-10 14:58:00.000000");
System.out.println(thisDate);
System.out.println("----------------------------");
System.out.println("After applying formating :");
String strDateOutput = changeFormat.format(temp);
System.out.println(strDateOutput);

}

}



Saturday 7 July 2018

invalid loc header (bad signature)

invalid loc header (bad signature) This error we will get due to bad or corrupt maven dependency.

Solution is Just delete that maven dependency. from .m2 location