Search code examples
javaquartz-scheduler.class-file

Why does some java code/quartz-code require a .class file?


Why does quartz or any java code require a .class file ? What is so special about the .class file that a regular api cannot provide ?

Code -

 JobDetail job = JobBuilder.newJob(HelloJob.class)
        .withIdentity("dummyJobName", "group1").build();

source - http://www.mkyong.com/java/quartz-2-scheduler-tutorial/


Solution

  • All Java code is compiled into .class files, so that shouldn't be surprising.

    But I think you're referring to the Foo.class syntax, which has nothing to do with .class files. It's simply a way to define a literal value of type Class<T>, much like you can use double quotes to define literal values of type String.