Rect rect = new Rect(50, 100, 200, 300);
Rect rect1 = new Rect(0, 0, 200, 200); Rect rect2 = new Rect(50, 50, 250, 250); rect1.intersect(rect2);
Rect rect = new Rect(); rect.set(50, 100, 200, 300);This code creates a new Rect object and then sets its coordinates using the set method. This results in a Rect with a left coordinate of 50, a top coordinate of 100, a right coordinate of 200, and a bottom coordinate of 300.