In Java "this" is always the current object - the one whose context the current method is executing in. The Thread constructor takes an instance of Runnable as its parameter, so "this" must be an object whose class implements the Runnable interface (which consists of a single run method). When the thread is started it will call the run method for the "this" object.
Java programmers are very pedantic - they have to be. You said
"I am wondering what the 'this' in the following code refers to ... I believe that it refers to the run method".
So technically that's false, even if you did have the right idea.
Anyway, mark this thread solved?
I am writing a java program that needs to execute shell commands, so I wrote a function that would take the command to execute as a string (ie: "mkdir ~/Folder1") and execute that command with the shell. Here is the function:
Runtime run = Runtime.getRuntime();
Process pr = ...
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"