4,Describe a situation where you would give the user a set of items with radio b
ID: 3542469 • Letter: 4
Question
4,Describe a situation where you would give the user a set of items with radio buttons; then, describe one where check boxes are more appropriate.
5,Explain the difference between the default constructor and a parameterized constructor.
6,Given the following constructor for the Circle class:
public Circle (int radius)
Fix the error in the following statement:
Circle round = Circle(500);
7,Explain the purpose of an event listener in event-driven programming. Give an example of an event and its event listener (describe, not with Java).
8,Given a class named Student, write the Java class header statement for a subclass of Student named GraduateStudent.
9,Given a frame class named Totals, write a constructor that sets its title to "Sales Totals", its size to 500 by 300 and makes it visible.
10,Given a JLabel named helpText, write the Java statement that will display the text in yellow.
Explanation / Answer
1) Radio buttons are used when we require only one option to be selected out of number of option. Ex while filling data for gender (Male or female)
checkboxes are used where we require multiple selection
ex when applying for a list of posts.
2)a default parameterless constructor is automatically created by the compiler if we dont define it The default constructor calls the default parent constructor (super()) and initializes all instance variables to default value (zero for numeric types, null for object references, and false for booleans).
Parametrized constructor are the overloaded constructors which will provide you control over creating any object instance of class
3)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.