• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error Not Understand!!!

 
babul bansal
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
import java.util.*;

public class Dates2 {
public static void main(String []) {
Dates d1 = new Dates(1000000000000L);
System.out.println("Ist date: "d1.toString());
}
}

F:\scjp>javac Dates2
error: Class names, 'Dates2', are only accepted if annotation processing is expl
icitly requested
1 error



What this error says?
How will this code compile on jdk1.6?
 
subhasish nag
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have modified a little in your code.Try with this

import java.util.*;

public class Dates2 {
public static void main(String []args) {
Date d1 = new Date(1000000000000L);
System.out.println("Ist date: "+d1.toString());
}
}
 
Vinod Kumar Kommineni
Ranch Hand
Posts: 54
Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no class named Dates ... its only java.util.Date as modified in above code.
 
babul bansal
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
 
Amardeep Salkar
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try This...

public class Dates2 {

public static void main(String[] args) {
java.util.Date d1 = new java.util.Date(1000000000000L);
System.out.println("Ist date: " + d1.toString());
}
}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic