Check if a point lies inside a rectangle | Set | Java program to Check if a point lies on or inside a rectangle | Set - 2 ; function to find if given point lies inside a given rectangle or not . ; Driver code ; bottom - left and top - right corners of rectangle ; given point ; function call
class GFG { static boolean FindPoint ( int x1 , int y1 , int x2 , int y2 , int x , int y ) { if ( x > x1 && x < x2 && y > y1 && y < y2 ) return true ; return false ; } public static void main ( String [ ] args ) { int x1 = 0 , y1 = 0 , x2 = 10 , y2 = 8 ; int x = 1 , y = 5 ; if ( FindPoint ( x1 , y1 , x2 , y2 , x , y ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }