Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In a separate document (called ExploreMethods.pdf ), you will make a list of (at least) 5 methods that you have used from other classes. For
In a separate document (called ExploreMethods.pdf), you will make a list of (at least) 5 methods that you have used from other classes.
- For each method, you should identify the major components of the method definition, as well as the class that the method comes from.
- Be sure to explain the expected return values as well as the type.
- Think about what classes you may have used/imported (Scanner, String, Character, Integer, Random, Arrays, Math, ...)
- Use Java API Documentation for the classes/methods if you get stuck. (There is a search bar that I just discovered that should make life easier..)
- Be sure to list methods from at least 3 classes (not including equals() from String as it is used as an example below).
- An example description is provided here:
Method header: public boolean equals (Object obj) (defined in String class)
- Modifiers: public
- Return type: boolean
- true if argument matches the string that called the method
- false if not
- Method Name: equals
- Parameter List: Object obj (String str)
- Input expected is an Object, which can include Strings.
- Note to class:
- If you are confused by Object, remember that Strings aren't primitive types. They are considered objects, and are conceptually an array of chars.
- We'll revisit Objects later (but just keep in mind that Object here means that a String is an acceptable input).
- Signature: equals(Object obj)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started