How would you declare a named instance of a Font class, and what arguments can be used within the constructor? Show the declaration for a font named fancyFont that is size 24, bold, underlined, and Helvetica.

What will be an ideal response?


One version of the Font constructor requires two arguments: a string and a float. The string is the name of the font. The float represents the font size. For example:
bigFont = new Font("Courier New", 16.5f);
You also can create a Font using three arguments, adding FontStyle as in:
Font arialItalic = new Font("Arial", 24, FontStyle.Italic);
You can combine multiple styles using the pipe (|). For example, the following code creates a Font that is bold and underlined:
Font fancyFont =
new Font("Helvetica", 24, FontStyle.Bold | FontStyle.Underline);

Computer Science & Information Technology

You might also like to view...

A terminal that immediately transmits characters as they are typed on the keyboard is a

a. smart terminal b. intelligent terminal c. dumb terminal d. none of the above

Computer Science & Information Technology

Which of the following is a form of solid-state storage?

A) CD B) Blu-ray C) DVD D) Flash drive

Computer Science & Information Technology

Which of the following is the unique address of the network interface card (NIC)?

a. IP address b. NIC address c. MAC address d. URL address

Computer Science & Information Technology

The separation of network infrastructure from the control layer, combined with the ability to centrally program a network design in a vendor-neutral, standards-based implementation, is an example of what important concept?

A. MPLS, a way to replace long network addresses with shorter labels and support a wide range of protocols B. FCoE, a converged protocol that allows common applications over Ethernet C. SDN, a converged protocol that allows network virtualization D. CDN, a converged protocol that makes common network designs accessible

Computer Science & Information Technology