Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Learn Java timertasks in 6 minutes! ⏲️
Play lesson

Java tutorial for beginners ☕ - Learn Java timertasks in 6 minutes! ⏲️

5.0 (4)
40 learners

What you'll learn

This course includes

  • 12 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

#java #javatutorial #javacourse import java.util.Timer; import java.util.TimerTask; public class Main { public static void main(String[] args) { // Timer = Class that schedules tasks at specific times or periodically // Useful for: sending notifications, scheduled updates, repetitive actions // TimerTask = Represents the task that will be executed by the Timer // You will extend the TimerTask class to define your task // Create a subclass of TimerTask and @Override run() Timer timer = new Timer(); TimerTask task = new TimerTask(){ @Override public void run(){ System.out.println("Hello!"); } }; timer.schedule(task, 0, 1000); // (task, delay, period) } }

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere