+ Start a Discussion
Krishnan MishraKrishnan Mishra 

What is "Database" in database.batchable?

Can anyone please explain this statement :
global class ContactBatch implements Database.Batchable<sObject>{
}

As far as I know Database is a class in apex and batchable is an interface, So why can't we write as: 
global class ContactBatch implements Batchable{
}

Also, explain the syntax for <sObject> here
VJayVJay
Implementing the Database.Batchable Interface. ... To collect the records or objects to pass to the interface method execute , call the start method at the beginning of a batch Apex job. This method returns either a Database.QueryLocator object or an iterable that contains the records or objects passed to the job.
Krishnan MishraKrishnan Mishra
Hi VJay,
Thanks for your answer. What I am asking is the meaning of "Database" here. Is it a class/package, and why the interface is written that way. Generally we implement interface simply by class's name followed by interface name. Here we are using class name followed by DATABASE.interface's name why??
VJayVJay
Hi Krishnan,
Here Databse is clase and Batchable is a interface. 

In jave we are using import statement but here we are using class name dot interface name. 

Thanks 
Vijay 
Krishnan MishraKrishnan Mishra
In Java import statement is used to import a package not an interface, so Is Database a package here?