this java class has a documentation comments describing the content to be added to it. Class Finder has 3 items TODO , write the code to add them to it /** * This class provides functions to search in arrays */ public class Finder { /** * Finder id */ private String id; /** * TODO: 1 * Constructor of the Finder type * * @param id String the id of the Finder */ public Finder(String id) { } /** * TODO: 2 * Getter method that returns the id of the Finder. * * @return String the id of the Finder */ public String getId() { } /** * TODO: 3 * Finds if an element is in an integer array. * * @param input Integer[] the array to search in * @param target Integer the value to search for * * @return int the index of the element if found, else -1 */ public int findElement(Integer[] input, Integer target) { } }
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
this java class has a documentation comments describing the content to be added to it.
Class Finder has 3 items TODO , write the code to add them to it
/**
* This class provides functions to search in arrays
*/
public class Finder {
/**
* Finder id
*/
private String id;
/**
* TODO: 1
* Constructor of the Finder type
*
* @param id String the id of the Finder
*/
public Finder(String id) {
}
/**
* TODO: 2
* Getter method that returns the id of the Finder.
*
* @return String the id of the Finder
*/
public String getId() {
}
/**
* TODO: 3
* Finds if an element is in an integer array.
*
* @param input Integer[] the array to search in
* @param target Integer the value to search for
*
* @return int the index of the element if found, else -1
*/
public int findElement(Integer[] input, Integer target) {
}
}
Step by step
Solved in 2 steps with 3 images