Examlex

Solved

Import Javax.swing.*; Import Java.awt.*;

question 38

Essay

import javax.swing.*;
import java.awt.*;
import java.awt.Color;
public class JDemoRectangles extends JFrame
{
Container con = getContentPane();
public JDemoRectangles()
{
con.setBackground(Color.BLUE);
con.setLayout(new FlowLayout());
}
public void paint(Graphics gr)
{
super.paint(gr);
gr.setColor(Color.RED);
gr.fillRect(40, 40, 120, 120);
gr.setColor(Color.YELLOW);
gr.fillRect(80, 80, 160, 160);
gr.clearRect(50, 60, 50, 50);
}
public static void main(String[] args)
{
JDemoRectangles frame = new JDemoRectangles();
frame.setSize(200, 200);
frame.setVisible(true);
}
}
Using the above code, describe what objects are drawn using the shaded statements of the paint() method.


Definitions:

Antitrust Law

Legislation intended to promote competition and protect consumers from monopolistic practices, merger, and acquisition strategies that limit market competition.

Conglomerate Mergers

The combination of two or more corporations engaging in entirely different businesses into a single corporate structure, typically to diversify business interests and investments.

Rapidly Changing Technology

Refers to the swift evolution and innovation in technology that impacts industries, markets, and society at large.

Natural Monopoly

A market in which a single firm can provide a good or service at a lower cost than any potential competitor, due to economies of scale.

Related Questions