aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Runnable Issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Runnable Issue" Watch "Runnable Issue" New topic

Runnable Issue

awad saleh

Joined: Jul 04, 2007
Posts: 22
Hello everyone..

As we know we create an object of interface. Then why the below program is getting executed..?
I need an explanation how it is getting executed.....?

public class Test {
public static void main(String[] args) {
new Thread(new Runnable() {
public void run() {

Thank Q.
arulk pillai
Ranch Hand

Joined: May 31, 2007
Posts: 3281
It is creating an inner class and executing the run() method. Have a look at Java inner classes.

500+ Java Interview Questions and Answers | Java job hunting know how & Java resumes
I agree. Here's the link:
subject: Runnable Issue