Click here to Skip to main content
15,917,991 members
Home / Discussions / Java
   

Java

 
GeneralRe: Polymorphism problem in java.. Pin
jschell12-Jul-11 10:11
jschell12-Jul-11 10:11 
GeneralRe: Polymorphism problem in java.. Pin
Shameel12-Jul-11 19:10
professionalShameel12-Jul-11 19:10 
GeneralRe: Polymorphism problem in java.. Pin
Richard MacCutchan12-Jul-11 23:16
mveRichard MacCutchan12-Jul-11 23:16 
GeneralRe: Polymorphism problem in java.. Pin
Shameel12-Jul-11 23:53
professionalShameel12-Jul-11 23:53 
AnswerRe: Polymorphism problem in java.. Pin
Ashish Tyagi 4012-Jul-11 4:46
Ashish Tyagi 4012-Jul-11 4:46 
Questionstatic keyword problem..... Pin
gateway237-Jul-11 20:54
gateway237-Jul-11 20:54 
AnswerRe: static keyword problem..... Pin
TorstenH.7-Jul-11 21:46
TorstenH.7-Jul-11 21:46 
GeneralRe: static keyword problem..... Pin
David Skelly7-Jul-11 22:53
David Skelly7-Jul-11 22:53 
I don't like the style you've shown here for the main method. It means that your entire application is running within the scope of MyObject's contructor, which just always feels wrong to me. A constructor is there to construct an object and get it ready to do work, not to do the actual work.

I would have two classes:

public class MyApp {

  public static void main(String[] args) {
    MyWorker w = new MyWorker();
    w.run();
  }

}

public class MyWorker implements Runnable {

  public void run() {
    // doStuff
  }

}


That way MyWorker can be regarded as a reusable service, and the startup code is completely separate.
GeneralRe: static keyword problem..... Pin
TorstenH.7-Jul-11 23:02
TorstenH.7-Jul-11 23:02 
AnswerRe: static keyword problem..... Pin
jschell8-Jul-11 12:18
jschell8-Jul-11 12:18 
AnswerRe: static keyword problem..... Pin
Shameel10-Jul-11 22:53
professionalShameel10-Jul-11 22:53 
AnswerRe: static keyword problem..... Pin
Ashish Tyagi 4013-Jul-11 6:25
Ashish Tyagi 4013-Jul-11 6:25 
QuestionProblem in Multithreading ,,.... Pin
gateway237-Jul-11 17:47
gateway237-Jul-11 17:47 
AnswerRe: Problem in Multithreading ,,.... Pin
TorstenH.7-Jul-11 19:34
TorstenH.7-Jul-11 19:34 
GeneralRe: Problem in Multithreading ,,.... Pin
David Skelly7-Jul-11 22:30
David Skelly7-Jul-11 22:30 
GeneralRe: Problem in Multithreading ,,.... Pin
TorstenH.7-Jul-11 22:42
TorstenH.7-Jul-11 22:42 
AnswerRe: Problem in Multithreading ,,.... Pin
David Skelly7-Jul-11 22:28
David Skelly7-Jul-11 22:28 
GeneralRe: Problem in Multithreading ,,.... Pin
gateway237-Jul-11 23:07
gateway237-Jul-11 23:07 
AnswerRe: Problem in Multithreading ,,.... Pin
Ashish Tyagi 4013-Jul-11 7:04
Ashish Tyagi 4013-Jul-11 7:04 
QuestionLoadin page while transferring control from one jsp to another jsp Pin
yog.khopade6-Jul-11 23:31
yog.khopade6-Jul-11 23:31 
AnswerRe: Loadin page while transferring control from one jsp to another jsp Pin
TorstenH.7-Jul-11 19:33
TorstenH.7-Jul-11 19:33 
AnswerRe: Loadin page while transferring control from one jsp to another jsp Pin
Richard MacCutchan7-Jul-11 23:08
mveRichard MacCutchan7-Jul-11 23:08 
QuestionUnchecked casting? Pin
Neo101016-Jul-11 22:03
Neo101016-Jul-11 22:03 
AnswerRe: Unchecked casting? Pin
David Skelly6-Jul-11 22:30
David Skelly6-Jul-11 22:30 
QuestionNEED HELP REGARDING EMBEDDING THE CHAT SERVER I MADE ON MY WEBSITE TO SERVE AS LIVE CHAT. [modified] Pin
Member 80110535-Jul-11 23:16
Member 80110535-Jul-11 23:16 

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.