• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multithreading

 
aryan sahu
Greenhorn
Posts: 11
Chrome Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

hello i am a new bie , i am having confusion regarding threads. Do the codes imply the same thing.
example



javascript:emoticon('');
 
Harsha Smith
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first code won't compile
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the first code you are trying to mark the overridden instance method to static - so you get the compile time error.

This behavior is common when you implement an interface or extend a super class.



Have a look at the table in the Summary section of this tutorial - http://download.oracle.com/javase/tutorial/java/IandI/override.html

As you see the error you get is 'static methods cannot hide the instance method in the super class / interface'.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic