Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

what is mean by JAVA0005 Imports not in specified order

Posted on 2011-05-04
10
Medium Priority
?
357 Views
Last Modified: 2012-05-11
what is mean by JAVA0005 Imports not in specified order

then what shold be the order ?

mport java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com. my application.package



And i want to know
noramlly how it sould ?
0
Comment
  • 5
  • 3
  • 2
10 Comments
 
LVL 16

Assisted Solution

by:Bryan Butler
Bryan Butler earned 200 total points
ID: 35691029
Try putting your import first.  I think it's grouping by package (first part) and then grouping by the rest (anything after the first ".").  "Com" comes first.
0
 
LVL 92

Accepted Solution

by:
objects earned 1800 total points
ID: 35691360
it just wants them in (alphabetic) order, makes it easier to find whats there

try this:

import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.myapplication.package.Abc
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
0
 
LVL 16

Expert Comment

by:Bryan Butler
ID: 35691425
Thanks Objects...forgot to mention that....it is what I was telling him to do :)
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 92

Expert Comment

by:objects
ID: 35691563
and com comes after javax, not first
0
 
LVL 16

Expert Comment

by:Bryan Butler
ID: 35692048
I thought it was alphabetical in which case com would be before javax, no?
0
 
LVL 92

Expert Comment

by:objects
ID: 35692092
java and javax have priority as they are core classes
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35701283
can you tell some orders
0
 
LVL 92

Assisted Solution

by:objects
objects earned 1800 total points
ID: 35702211
java imports
javax imports
the rest

and alphabetic order by name
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35704236
Oh then com package  shold coming 1st right ?

is it exceptionfor  java and javax?
0
 
LVL 92

Assisted Solution

by:objects
objects earned 1800 total points
ID: 35704245
> Oh then com package  shold coming 1st right ?

no

> is it exceptionfor  java and javax?

yes
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month15 days, 9 hours left to enroll

575 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question