Which three statements are true about the structure of a Java class?

Which three statements are true about the structure of a Java class?
A. A class can have only one private constructor.
B. A method can have the same name as a field.
C. A class can have overloaded static methods.
D. A public class must have a main method.
E. The methods are mandatory components of a class.
F. The fields need not be initialized before use.

Download Printable PDF. VALID exam to help you PASS.

4 thoughts on “Which three statements are true about the structure of a Java class?

  1. A is incorrect. you can have private overloaded constructor.

    public class Person {

    private String firstName;
    private String lastName;

    private Person() {};

    private Person(String firstName ) {
    this.firstName=firstName;
    }

    public Person(String firstName,String lastName) {
    this(firstName);
    this.lastName=lastName;
    }

    @Override
    public String toString() {
    return “Person [firstName=” + firstName + “, lastName=” + lastName + “]”;
    }

    }

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.