• Post Reply Bookmark Topic Watch Topic
  • New Topic

jdk versions  RSS feed

 
Saptarshi Talukdar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried to run the following program in ubuntu 11.04 using jdk6.0 and windows vista using jdk 7.0 and got two different outputs:
class M
{
static
{
System.out.println("SIB");
}
}
for jdk 6.0 the output was : SIB
from main exception
for jdk the output was: from main exception

For some programs the output was same in both the jdks but not in this one
 
Gaurangkumar Khalasi
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saptarshi Talukdar wrote:I tried to run the following program in ubuntu 11.04 using jdk6.0 and windows vista using jdk 7.0 and got two different outputs:

for jdk 6.0 the output was : SIB
from main exception
for jdk the output was: from main exception

For some programs the output was same in both the jdks but not in this one


Java program without writing main method is allowed in JDK 6 but not in 7(especially for standalone java app.)...

Just go through the following an many others(you can search on javaranch):
http://www.coderanch.com/t/407661/java/java/we-write-java-program-without
http://www.coderanch.com/t/471679/java/java/run-normal-java-program-without
http://www.coderanch.com/t/407561/java/java/Do-Java-program-run-without
http://www.coderanch.com/t/406107/java/java/Program-without-main-method
http://www.coderanch.com/t/383115/java/java/JAVA-program-run-without-main
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!