Can Integer and int be used interchangeably

Actually No, but since Java has auto(automatic or built in) boxing and unboxing feature. Hence it can be used without any exceptions. But internally how it works is clearly explained in this file.