Click here to Skip to main content
15,393,837 members
Home / Discussions / Java
   

Java

 
PinnedForum Guidelines - PLEASE READ Pin
Chris Maunder28-Jul-09 2:36
cofounderChris Maunder28-Jul-09 2:36 
QuestionSocket connection offline vs busy Pin
JohnCodding9-Aug-22 20:26
MemberJohnCodding9-Aug-22 20:26 
AnswerRe: Socket connection offline vs busy Pin
Richard MacCutchan9-Aug-22 21:03
mveRichard MacCutchan9-Aug-22 21:03 
GeneralRe: Socket connection offline vs busy Pin
JohnCodding9-Aug-22 21:10
MemberJohnCodding9-Aug-22 21:10 
GeneralRe: Socket connection offline vs busy Pin
Richard MacCutchan9-Aug-22 21:12
mveRichard MacCutchan9-Aug-22 21:12 
GeneralRe: Socket connection offline vs busy Pin
Richard MacCutchan9-Aug-22 21:17
mveRichard MacCutchan9-Aug-22 21:17 
GeneralRe: Socket connection offline vs busy Pin
JohnCodding9-Aug-22 21:36
MemberJohnCodding9-Aug-22 21:36 
GeneralRe: Socket connection offline vs busy Pin
Richard MacCutchan9-Aug-22 21:45
mveRichard MacCutchan9-Aug-22 21:45 
AnswerRe: Socket connection offline vs busy Pin
Gerry Schmitz10-Aug-22 4:13
mveGerry Schmitz10-Aug-22 4:13 
QuestionUser Path not working until computer restart Pin
Valentinor13-Jul-22 9:27
MemberValentinor13-Jul-22 9:27 
AnswerRe: User Path not working until computer restart Pin
Valentinor13-Jul-22 23:28
MemberValentinor13-Jul-22 23:28 
QuestionDistribute software that uses Java Pin
Valentinor7-Jul-22 9:28
MemberValentinor7-Jul-22 9:28 
AnswerRe: Distribute software that uses Java Pin
Gerry Schmitz7-Jul-22 19:46
mveGerry Schmitz7-Jul-22 19:46 
AnswerRe: Distribute software that uses Java Pin
Dave Kreskowiak8-Jul-22 11:30
mveDave Kreskowiak8-Jul-22 11:30 
GeneralRe: Distribute software that uses Java Pin
Valentinor8-Jul-22 19:32
MemberValentinor8-Jul-22 19:32 
GeneralRe: Distribute software that uses Java Pin
Dave Kreskowiak8-Jul-22 19:40
mveDave Kreskowiak8-Jul-22 19:40 
GeneralRe: Distribute software that uses Java Pin
Valentinor8-Jul-22 21:51
MemberValentinor8-Jul-22 21:51 
GeneralRe: Distribute software that uses Java Pin
Dave Kreskowiak9-Jul-22 5:43
mveDave Kreskowiak9-Jul-22 5:43 
Questionsolve the error Pin
Member 156672428-Jun-22 21:02
MemberMember 156672428-Jun-22 21:02 
RantRe: solve the error Pin
Richard Deeming8-Jun-22 21:19
mveRichard Deeming8-Jun-22 21:19 
AnswerRe: solve the error Pin
Richard MacCutchan8-Jun-22 22:56
mveRichard MacCutchan8-Jun-22 22:56 
AnswerRe: solve the error Pin
Sakshi Jain 202226-Jun-22 20:59
MemberSakshi Jain 202226-Jun-22 20:59 
GeneralRe: solve the error Pin
Richard MacCutchan26-Jun-22 21:41
mveRichard MacCutchan26-Jun-22 21:41 
GeneralRe: solve the error Pin
Peter_in_278026-Jun-22 22:19
professionalPeter_in_278026-Jun-22 22:19 
QuestionRunnable as a new object? Pin
Member 156629325-Jun-22 13:24
MemberMember 156629325-Jun-22 13:24 
Hello. I'm new to Java -- I want to learn, and am going through HFJ. I know it's an old book, but there are no later editions, so I may be behind the times.

I'm not a professional programmer, but I'm on a few programming forums, and I can't seem to get an answer to a question I have regarding the Runnable interface. I'm in chap 15 of the book re: threading, and I came across this statement in regards to starting a new thread:

public class MyRunnable implements Runnable

Runnable threadJob = new MyRunnable ()

What I don't understand is how can you make a new object with an interface, but use the class MyRunnable. Shouldn't it be MyRunnable thread = new MyRunnable ()?

I'm just confused. Runnable isn't a class, so what's going on?

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.