Van Wanless

Greenhorn
+ Follow
since Oct 10, 2019
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Van Wanless

Many times I want a quick back door into a Java application I've written.  For various reasons, using JConsole isn't really an option, so I have a simple Console class that listens to connection attempts on a configured IP port, and then I use telnet to talk to the Console.  The Console uses a Scanner to read the Socket's inputStream.  Now, when I use Scanner with System.in, I automatically get simple command-line editing; I can backspace to delete characters and re-enter them.  When I use the Scanner to read the Socket's inputStream, I get no command-line editing.  Who supplies the command line editing feature?  Is there any way to get it when using a Socket inputStream?
1 week ago
That is actually the best and clearest explanation I have ever heard.
1 month ago
Or, as I started this topic:

As Junilu pointed out in his very helpful answer, this is equivalent to declaring an anonymous Runnable.  Even if I had declared an explicit Runnable, I'd still have to spin up a thread to run it.  
And yes, I do know about Futures and Callables and ThreadPoolExecutors.  But that wasn't the question I asked.  I have looked at the web trying to get an answer to the Thread vs Runnable question, and despite special pleading for Runnables as "preserving the option to inherit from other than class Thread", and "Runnables can be reused" there are lots of times when these just aren't an issue.  As far as I can tell, it boils down to personal preference.
1 month ago
I can write:
 
But when I write:
 
I get an error:
 
I've tried creating various constructors for MyThread, and I've looked at the Thread source code trying to understand, but I haven't been able to figure out why it works for Thread but not for MyThread.  I
1 month ago