1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Pavel [41]
3 years ago
14

Consider the following method substringFound, which is intended to return true if a substring, key, is located at a specific ind

ex of the string phrase. Otherwise, it should return false.
public boolean substringFound(String phrase, String key, int index)
{
String part = phrase.substring(index, index + key.length());
return part.equals(key);
}
Which of the following is the best precondition for index so that the method will return the appropriate result in all cases and a runtime error can be avoided?
A. 0 <= index < phrase.length()
B. 0 <= index < key.length()
C. 0 <= index < phrase.length() + key.length()
D. 0 <= index < phrase.length() - key.length()
E. 0 <= index < phrase.length() - index
Computers and Technology
1 answer:
Nadusha1986 [10]3 years ago
3 0

D. 0 <= index < phrase.length() - key.length()

You might be interested in
Qbasic program to check whether an entered number is positive or negative or neutral​
igor_vitrenko [27]

Answer:

CLS

INPUT "Enter a number: ",N

IF N > 0 THEN

PRINT "The number is Positive."

ELSEIF N < 0 THEN

PRINT "The number is Negative."

ELSE

PRINT "The number is Zero."

END IF

END

7 0
3 years ago
InJava garbage collection is done by_______________JVM (Java VirtualMachine)ProgrammerBoth JVM (Java Virtual Machine)and Program
lozanna [386]

Answer: Java Virtual Machine(JVM)

Explanation: In java,there is the process of the management of the memory by own self or automation , this is known as the garbage collection .The program in it compile to be executed by the java virtual machine(JVM).During this process , object get together in a sort of heap and then unnecessary object are detected which are of no use and delete them to make space for the memory  . Therefore, garbage collection is carried out by java virtual machine(JVM).

7 0
3 years ago
Which feature does the web designer fail to apply in this layout for a web page? A. harmony
iogann1982 [59]
The answer is D.balance
3 0
3 years ago
Read 2 more answers
Why is this app here to help but wont let me see answers to my questions?
UkoKoshka [18]

Answer:

maybe you need to reload the page and press the little bell on the right side and u should get a notification when somebody answers your question and if that doesnt help go to your profile and press the tab (on this tab if that makes since) it should say sumin like questions you asked and u should press the ones u need the answers to

Explanation:

lmk if this helped

5 0
3 years ago
Read 2 more answers
Question 6 options: This is a category or partitioned group of the small units of a programming language include its numeric lit
Wittaler [7]

Lexeme is a category or partitioned group of the small units of a programming language include its numeric literals, operators, and special words.

<h3>What is a lexeme in programming?</h3>

Lexemes are known to be those character strings that are put together from the character group of a program, and the token stands for what aspect of the program's grammar they are made of.

Hence, Lexeme is a category or partitioned group of the small units of a programming language include its numeric literals, operators, and special words.

Learn more about Lexeme from

brainly.com/question/14125370

#SPJ1

6 0
2 years ago
Other questions:
  • Which piece of information is most useful to an identity thief? *
    6·1 answer
  • Are there any tips or helpful advice for people who want to learn Photoshop?
    10·1 answer
  • How do humans acquire voltage in their bodies
    8·1 answer
  • What is the meaning of Android
    12·2 answers
  • State The function<br>of floppy disk​
    10·1 answer
  • What does the binary odometer show about representing large numbers?
    8·1 answer
  • This is a while loop question for Information technology.
    11·1 answer
  • Name the contributory components that are considered when determining an E/M code; they are not considered key components:
    15·1 answer
  • 1 Which one of the following is a transmission
    9·1 answer
  • From the introductory conversation chip and anna shared, which elements mentioned might suggest the use of case tools?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!