Core Java Tutorials


Introduction

Java Hello World

Java Compilation

JDK New Features

JVM Architecture

Java OOPs Concepts

Java Package

Array

Exception Handling

String

Immutable Class

File Handling

Serialization

MultiThreading

Volatile

Concurrent Package

Collection

Collection Internal

Generics

Cloning

Reflection In Java

Annotation

Class Loader

Java Inner classes

Garbage Collector

JDBC

References In Java

Heap Dump & Thread Dump

/java/java-annotationsPrevious             Next

Callable Interface

callable-interface

 A Callable needs to implement call() method while a Runnable needs to implement run() method.
  A Callable can return a value but a Runnable cannot.
  A Callable can throw checked exception but a Runnable cannot.

public interface Runnable {
     void run();
}

public interface Callable {
      V call() throws Exception;
}

Example of Callable with ExecutorService Interface:-

callable-example