java explained solution with new testCases
Idea:\nThere are only case possible if intersection is there.\n\n\nthese are the cases when intersection is possible. If we observe \nCondition 1:  x1<x4 && y1<
**Idea:**\nThere are only case possible if intersection is there.\n![image](https://assets.leetcode.com/users/images/4a8bda1d-57c5-4613-9a77-fa65e0dfd9f8_1620738378.9237978.jpeg)\n\nthese are the cases when intersection is possible. If we observe \nCondition 1:  x1<x4 && y1<y4 \nCondition 2:  x3<x2 && y3<y2\n  then only intersection is there.\n  \n* Area should be positive. So if one of given rectangle is line ,return false.\n   \n**CODE:**\n```\n public boolean isRectangleOverlap(int[] rec1, int[] rec2) {\n         if (rec1[0] == rec1[2] || rec1[1] == rec1[3] \n           || rec2[0] == rec2[2] || rec2[1] == rec2[3]) {\n            return false; // a line\n        }\n\n        boolean cnd1=(rec1[0]<rec2[2] && rec1[1]<rec2[3]);\n        boolean cnd2=(rec1[2]>rec2[0]  && rec1[3]>rec2[1]);\n        \n        return cnd1 && cnd2;\n    }\n```\n\nComplexity:\n`Time:O(1) and Space:O(1)`
['Java']