Question

If Person Is a class and getName() Is a method def

0 0
Add a comment Improve this question Transcribed image text
Answer #1

option c

Person::getName                                                                                                                             

Add a comment
Know the answer?
Add Answer to:
If Person Is a class and getName() Is a method defined In this class, which of...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 5. Assume that Person is a predefined class and that the declaration Person[] people; has already...

    5. Assume that Person is a predefined class and that the declaration Person[] people; has already been performed. Then the instruction People = new Person [200]; Reserves memory space for(Circle the answer):      Option 1: a single Person object      Option 2: 200 Person objects      Option 3: a single reference variable that points to a single Person object      Option 4:200 reference variables and 200 Person objects      Option 5: 200 reference variable, each of which can point to...

  • in java Define a class named ComparableNames thats extends Person and implements comparable Define a class...

    in java Define a class named ComparableNames thats extends Person and implements comparable Define a class named ComparableNames that extends Person (defined below) and implements Comparable. Override the compare To method to compare the person on the basis of name. Write a test class to find the order of two ComparableNames. class Person String name; Person00 Person(String n) name=n: Hint: in class ComparableName, you only need a constructor with arg to initialize the data filed defined in the super class...

  • The method m() of class B overrides the m() method of class A, true or false?...

    The method m() of class B overrides the m() method of class A, true or false? class A int i; public void maint i) { this.is } } class B extends A{ public void m(Strings) { 1 Select one: True False For the following code, which statement is correct? public class Test { public static void main(String[] args) { Object al = new AC: Object a2 = new Object(); System.out.println(al); System.out.println(a): } } class A intx @Override public String toString()...

  • C++, entry level no pointers or vectors. Write a class called Person that has two data...

    C++, entry level no pointers or vectors. Write a class called Person that has two data members - a string variable called name and a double variable called age. It should have a constructor that takes two values and uses them to initialize the data members. It should have get methods for both data members (getName and getAge), but doesn't need any set methods. Write a separate function (not part of the Person class) called stdDev that takes two parameters...

  • Show how a class and a method are defined, how the method is called, and how...

    Show how a class and a method are defined, how the method is called, and how it can return a value.  Remember that you need to create an object of the class before you can call its methods. You should create your class and call its method in another class that has a main method.

  • Java Program (PLEASE PROVIDE SCREENSHOT OF THE CODE) Create a class Person which is a super...

    Java Program (PLEASE PROVIDE SCREENSHOT OF THE CODE) Create a class Person which is a super class. The class includes four private String instance variables: first name, last name, social security number, and state. Write a constructor and get methods for each instance variable. Also, add a toString method to print the details of the person. After that create a class Teacher which extends the class, Person. Add a private instance variable to store number of courses. Write a constructor...

  • Consider the following C++ program // class declaration class person public: -person)i person ( ) person...

    Consider the following C++ program // class declaration class person public: -person)i person ( ) person (int age) i int get_age ()i private: int agei hi // class implementation person::-person age1ih person: :person age-1i) person: :person (int val) 1 ageval; > int person::get_age() return agei h int main) person lucky (42)i person group[1017 person fredi // code qoes here [8 points] Which of the following are valid C++ statements that could be compiled and executed in the main function above?...

  • in java • Create an interface called Person. In this interface create a method called printData()...

    in java • Create an interface called Person. In this interface create a method called printData() • Implement interface Person by classes Student, Teacher, Admin. You need to think the relevant data attributes for each class. Define atleast 4 attributes for each class. • In each class override a method toString() and create a string which holds all data • In the method printData in each class print the data using toString() method. Design the UML and write a code...

  • Exercise 1: Adding a Test Harness to the Person class To make it easier to test...

    Exercise 1: Adding a Test Harness to the Person class To make it easier to test code that you have written for a Java class you can add to that class a main method that acts as a "test harness". A test harness is a main method that includes calls to methods that you wish to test. For convention this main method is the last method of the class. If you have a test harness, you do not need to...

  • Declare a Person class having two data members, Name of type string, and DOB (date of...

    Declare a Person class having two data members, Name of type string, and DOB (date of birth) of type Date. Assume that the Date class has already been written for you and you can use it by including the header file. Declare and define an appropriate constructor, and the functions setName, setDOB, getName and getDOB for this class. You need to write the complete code for declaring and defining this Person class with the given specifications.

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT