Multiple choice

How many parameters are passed to the constructor of the Font class in java?

  1. 4

  2. 3

  3. 2

  4. 1

  5. None of these

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

 
This is correct The constructor of the Font class takes three parameters :- First parameter is of String type, which specifies the name of the Font. Second parameter is of type int, which specifies the style of the font like Font.BOLD. Third parameter is of type int, which specifies the size of the font. Example, Font f1 = new Font(“Serif”, Font.BOLD, 32); So this option is true.