পৃষ্ঠাসমূহ

Search Your Article

CS

 

Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.

At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.

What We Offer:

  • 📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.

  • 💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.

  • 🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.

  • 🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.

    Latest world News 

     

Our Vision

To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.

Why Choose Us?

✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing

We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.

📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.

Pageviews

Thursday, January 19, 2017

Java.util.Timer Class

Introduction

The java.util.Timer class provides facility for threads to schedule tasks for future execution in a background thread.

  • This class is thread-safe i.e multiple threads can share a single Timer object without the need for external synchronization.
  • This class schedules tasks for one-time execution, or for repeated execution at regular intervals.
  • All constructors start a timer thread.

Class declaration

Following is the declaration for java.util.Timer class:
public class Timer
   extends Object

Class constructors

S.N. Constructor & Description
1 Timer()
This constructor creates a new timer.
2 Timer(boolean isDaemon)
This constructor creates a new timer whose associated thread may be specified to run as a daemon.
3 Timer(String name)
This constructor creates a new timer whose associated thread has the specified name.
4 Timer(String name, boolean isDaemon)
This constructor creates a new timer whose associated thread has the specified name, and may be specified to run as a daemon.

Class methods

S.N. Method & Description
1 void cancel()
This method terminates this timer, discarding any currently scheduled tasks.
2 int purge()
This method removes all cancelled tasks from this timer's task queue.
3 void schedule(TimerTask task, Date time)
This method schedules the specified task for execution at the specified time.
4 void schedule(TimerTask task, Date firstTime, long period)
This method schedules the specified task for repeated fixed-delay execution, beginning at the specified time.
5 void schedule(TimerTask task, long delay)
This method schedules the specified task for execution after the specified delay.
6 void schedule(TimerTask task, long delay, long period)
This method schedules the specified task for repeated fixed-delay execution, beginning after the specified delay.
7 void scheduleAtFixedRate(TimerTask task, Date firstTime, long period)
This method schedules the specified task for repeated fixed-rate execution, beginning at the specified time.
8 void scheduleAtFixedRate(TimerTask task, long delay, long period)
This method Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.

Methods inherited

This class inherits methods from the following classes:
  • java.util.Object

No comments:

Post a Comment