Skip to content

Tag: methods

How to add two integers in one line

Hello im new to java and in my class my prof wants us to create a program that will compute the sum of two numbers. (Use methods) For example: Input an integer: 95 //Expected Output: The sum is 14 //(9+5=14) im really lost on this one because i really don’t know how to do this please help Answer If you

What is the appropriate use for the .replace method within this context/ within a .map method?

I’m trying to loop through an array of strings and for each element(string) in that array, change the character after the “_” underscore character to a “*” character. Strings are immutable so, pushing this all to a new array. The chain performs as expected when directly targeting the underscore for replacement: But the moment the actual intended function is pursued,

Details about window.stop()

I just came across the window.stop() The stop() method is exactly equivalent to clicking the stop button in the browser. Because of the order in which scripts are loaded, the stop() method cannot stop the document in which it is contained from loading, but it will stop the loading of large images, new windows, and […]