Java Video Tutorial 18

Java ThreadsIn this Java Video Tutorial, I continue to teach you about Java Threads. If you missed the last part, watch it first here last Java Tutorial.

Today I cover how to lock down methods, synchronized, thread pools, scheduleAtFixedRate and numerous other Java Thread methods.

Use the code that follows the video to make it easier to follow this tutorial. It is heavily commented and will help you.

If you like videos like this share it [nttfblike]

Code From the Video

LESSONEIGHTEEN.JAVA

CHECKSYSTEMTIME.JAVA

PERFORMSYSTEMCHECK.JAVA

25 thoughts on “Java Video Tutorial 18”

  1. Hi, great videos! Just wondering about why the TimeUnit library has to be static? Line 3 in JavaLessonEighteen.

    1. It doesn’t have to be. I’m not sure why I did that? I improv my way through these tutorials and on occasion I do something silly

      1. Ok, thank you for quick answer! And the tutorials are just great, have been through 1-24 now and my understanding of Java Programming is so much better than after all the other java tutorials I’ve tried out!

        1. Thank you. I’m very happy to hear that. I always wonder who my competition is. I don’t watch any other tutorials so I don’t know what I’m up against.

          1. There are alot of other talented guys making tutorials on Java, but your pace suits me very well. The others are often a bit slow. Also the fact that you edit your tutorials is as far as I can tell very rare but very nice for us viewers!

            1. Well, thank you very much. It is time consuming to edit them, but I think the extra time sets me apart. I’m glad you took the time to say Hi πŸ™‚

  2. hello derek, i am getting error on line no 30,32,34 . the eclipse throws error “SECONDS cannot be resolved to a variable”.I completely copied this lessons code, i its throwing this error.plz do explain

  3. hello derek, i am getting error on line no 30,32,34 . the eclipse throws error “SECONDS cannot be resolved to a variable”.I completely copied this lessons code, i its throwing this error.plz do explain

  4. So this pretty much explains the concept of multi threading? Or is that something else? I would think multi-threading involves running the threads at the same time not scheduled threads.

  5. Exception in thread “main” java.lang.Error: Unresolved compilation problems:
    SECONDS cannot be resolved to a variable
    SECONDS cannot be resolved to a variable
    SECONDS cannot be resolved to a variable

    at LessonEighteen.addThreadsToPool(LessonEighteen.java:15)
    at LessonEighteen.main(LessonEighteen.java:10)

  6. Exception in thread β€œmain” java.lang.Error: Unresolved compilation problems:
    You should write TimeUnit.SECONDS, that`s enum in java except using only SECONDS

  7. Hi, your video tutorials are awesome!! Thank you for this great vidoes.

    I have a question. Why we used try block in addThreadToPool() method?

    try{
    Thread.sleep(20000);
    }
    catch(InterruptedException e){}

    Best Regard,
    Burak

  8. Is there a limit to how many threads can be started? Is there any type of architecture dependency for threads, like does it have to be multi-CPU etc for the threads to run simultaneously?

Leave a Reply

Your email address will not be published. Required fields are marked *