Question

IN JAVA 38.   What is the return type of the String class compareTo( ) method? A) boolean...

IN JAVA

38.   What is the return type of the String class compareTo( ) method?

A) boolean B) int C) String D)coid

39.    What is the return type of the constructor method of a class?

A) void B) Object    C) no return type is allowed   D) int

40.    A class can have many different constructor methods as long as the names are different.

A)true     B) false

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

38.   What is the return type of the String class compareTo( ) method?

Answer: B) int

39.    What is the return type of the constructor method of a class?

Answer: C) no return type is allowed

40.    A class can have many different constructor methods as long as the names are different.

Answer: B) false

Add a comment
Know the answer?
Add Answer to:
IN JAVA 38.   What is the return type of the String class compareTo( ) method? A) boolean...
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
  • java True or False, the below compareTo method is a good implementation for the Candy class?...

    java True or False, the below compareTo method is a good implementation for the Candy class? public abstract class Candy implements Comparable<Candy> { String name; int numCalories; public abstract void greeting(); public int compareTo(Object o) { if(this == o) { return 0; } else if (!(o instanceof Candy)) { return -1; } else { Candy c = (Candy) o; if(this.equals(c)) { return 0; } else if (this.name.equals(c.name)) { return this.numCalories - c.numCalories; } else { return this.name.compareTo(c.name); } } }...

  • Within a class I need to create a method that is return type boolean. This method...

    Within a class I need to create a method that is return type boolean. This method accepts a String as a parameter that represents a file path. If the file path exist it should return true else it returns false. When I call the method it should load the file based on the parameter that was passed. (This is done in JAVA)

  • JAVA LANGUAGE In Java, single text characters are represented by what data type? Which of the...

    JAVA LANGUAGE In Java, single text characters are represented by what data type? Which of the following statements about constructors are true? Circle all that apply. a) A class can have many methods but only one constructor. b) A constructor can be used instead of fields to represent the data inside a class. c) A constructor wastes memory in the computer so it should be used sparingly. d) A constructor is a special method that creates an object and initializes...

  • Writing 3 Java Classes for Student registration /** * A class which maintains basic information about...

    Writing 3 Java Classes for Student registration /** * A class which maintains basic information about an academic course. */ public class Course {    /** * Attributes. */ private String code; private String title; private String dept; // name of department offering the course private int credits; /** * Constructor. */ public Course(String code, String title, int credits) { // TODO : initialize instance variables, use the static method defined in // Registrar to initialize the dept name variable...

  • Java Time Class Class declarations are one of the ways of defining new types in Java....

    Java Time Class Class declarations are one of the ways of defining new types in Java. we will create two classes that both represent time values for a 24 hours period. The valid operations are as follows. int getHours(): returns the number of hours int getMinutes(): returns the number of minutes int getSeconds(): returns the number of seconds String toString(): returns a String representation boolean equals(Time other): returns true if and only if other designates an object that has the...

  • e fellowing class declaration to answer the questionist below class WeatherStation public emp, double wind, string...

    e fellowing class declaration to answer the questionist below class WeatherStation public emp, double wind, string wind dir, double prediplk void void void int Winda int getTempo double getWindSpeed) : string getWind Direction): double getPrecipitation: void setTemp(int t void setWindData(double w, string dir): void setPrecip(double pl printTempO private int temperature double windSpeed, precipitation string windDir method 14) 14) Refer to the class declaration above. Which of the following methods is an accessor A) int WindChillo: C) WeatherStation: B) void setPrecipO...

  • JAVA QUESTION 1 The value returned by a value-returning method can be saved for further calculation...

    JAVA QUESTION 1 The value returned by a value-returning method can be saved for further calculation in the program. True False QUESTION 2 To use a predefined method you must know the code in the body of the method. True False QUESTION 3 A formal parameter is a variable declared in the method heading (ie. it's signature). True False QUESTION 4 A local identifier is an identifier that is declared within a method or block and that is visible only...

  • Hello. I need help writing the following Java Program. Thank you Develop a class encapsulating the...

    Hello. I need help writing the following Java Program. Thank you Develop a class encapsulating the concept of a college course, assuming that a course has following attributers: code (for instance COSC1337), a description, and a number of credits (for instance 3). Include a constructor, the accessors, mutators and methods ‘toString’, ‘equals’, and ‘finalize’. Write a client class to test the behavior of the class and its methods. The outline of the class is given as follows: public class Course...

  • This needs to be done in Java. Please use basic Java coding at an intro level....

    This needs to be done in Java. Please use basic Java coding at an intro level. THANK YOU FOR YOUR HELP! I WILL LEAVE A GOOD RATING! Design and implement MoneyTest and Money. Use the test-first approach, as we discussed, and document each method before implementing. Money - dollars : int - cents : int + Money (int, int) + getDollars() + getCents() + add (Money) : Money + subtract (Money) : Money + toString() : String + equals (Money)...

  • Horse Team(Java) . Horse -name:String -age:int -weight:double +Horse():void +Horse(String, int double):void +getName():String +getAge():int +getWeight():double +setName(String):void +setAge(int):void...

    Horse Team(Java) . Horse -name:String -age:int -weight:double +Horse():void +Horse(String, int double):void +getName():String +getAge():int +getWeight():double +setName(String):void +setAge(int):void +setWeight(double):void +compareName(String):boolean +compareTo(Horse):int +toString():String Team -team:ArrayList<Horse> +Team():void +addHorse(String, int, double):void +addHorse(Horse):void +averageAge():int +averageWeight():int +getHorse(int):Horse +getSize():int +findHorse(String):Horse +largestHorse():Horse +oldestHorse():Horse +removeHorse(String):void +smallestHorse():Horse +toString():String +youngestHorse():Horse HorseTeamDriver +main(String[]):void Create a class (Horse from the corresponding UML diagram) that handles names of horse, the age of the horse, and the weight of the horse. In addition to the standard accessor and mutator methods from the instance fields, the class...

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