Import Statement - Which is Better ???

Which import statement is better? Are there any performance advantages of calling the ones you need explicitly instead of using the shorthand (.*)?
import java.util.*
or
import java.util.Vector;
import java.util.TreeMap;

there is no runtime performance difference. There could be a difference in compliation time if you use wildcards, but even that difference would probably be insignificant (plus, is compile time usually a concern in java?). The main advantage to importing only the classes you need, as the previous poster pointed out, is to reduce compilation ambiguities (e.g. does 'Date' refer to java.sql.Date or java.util.Date). For example, a recent poster just reported a problem where he imported java.beans.* and java.sql.* and, after upgrading to 1.4, none of his code compiles because both packages now have a Statement class, which causes ambiguities. As a general rule, it is best to import only the classes you need.

Similar Messages

  • Error on import statement.

    I got compiler error for an import statement which is: import MyClass;
    It said: '.' expected at the end of the statement. However, MyClass isn't any package. Also, I can compiler the same code with the import statement as above on other machine with no error. So, I'm thinking there might be some kind of settings for windows that I've done wrong.
    I have my path point to jdk\bin and my classpath point to current directory. I'm using win2k + jdk1.3.1
    Anyone has idea about this??
    Cheers,

    Didn't you ask this once before?
    Anyway, the statementimport Myclass; is malformed. You cannot explictly import a member of the default package, and you don't need to, they are already imported as are those classes defined in your package and those classes defined in java.lang.
    Chuck

  • Which one better to use - jsp:useBean or import statement

    Hi,
    I just want to know that which one is better to use jsp:useBean or import statement .
    I can instantiate and call method of myclass -
    1) by importing the class through import tag in jsp as <%@page import="myclass"%. or
    2). by using <jsp:useBean tag....
    i have these two option to do the same thing. i know that basically useBean is used to call setter and getter method of bean class and but it can be used to call a normal java file that have some logic .
    so what should i used , which one is better and why?
    useBean provides scope and object instance so no need to create object by new operator. and with import you have to create an instance .
    but which tag should i use in my jsp?
    i am confused???

    ok, means i can use jsp:useBean tag for all my
    classes that are not actually bean. so it will be
    instantiated at run time and provide efficiency .No. Jsp:useBean is used for java bean components.
    >
    but when should i use import statement in my jsp and
    it happen at translation time so will it create any
    type of burden for my code if i import multiple
    classes.For non-java beans, you need to import the classes, period.
    It's not a burden, it's a necessity.

  • FB Beta 2 removing import statements

    I have a project that was started in FB Beta 1 (everything was working great) and updated to FB Beta 2 SDK 4.0.0.10988.  I have a frequent but inconsistent problem in which while working in a module I'll have import statements in my script removed.  The last instance two import statements for user created MXML components were removed, and the code I was modifying didn't have anything to do with these components.  Previously I had import statements for ConversionType and TextConverter removed, this time I put the import statements in right before writing code to use them.
    I still have problems with Flash Builder Beta 2 output folder issues this is a previous post that was unanswered.
    If it helps: using MAC OSX and FB Beta 2 standalone.

    The issue with comments being removed when organize imports is run is a known issue captured by a small set of bugs:
    https://bugs.adobe.com/jira/browse/FB-18479 Comments do not remain with currect import statements when performing 'organize imports'
    https://bugs.adobe.com/jira/browse/FB-11396 Any data in between imports are deleted when doing an "organize imports" operation
    https://bugs.adobe.com/jira/browse/FB-17160 Import inserted into wrong location when existing import is followed by a single line comment
    Essentially, what it boils down to, we follow the same behavior as the JDT with one glaring exception: Turn off organizing imports when auto importing from code hints:
    https://bugs.adobe.com/jira/browse/FB-23179 Change code hints auto import behavior so that imports are inserted in order, but unused imports should not be removed
    With the FB-23179 fix, your imports will only be removed when you explicitly organize imports. I hope this info helps.
    Jason San Jose
    Quality Engineer, Flash Builder

  • Why assertion instead of if statement ?  Which is better to use ?

    Why assertion instead of if statement ? Which is better to use ?

    Never assertion instead of if statement. The two have fundamentally different intents. Using assert to control program flow is a bad idea

  • Which is better - SQL Statement in APEX or as a function returning a type?

    Hi
    I have a general question about best practices for APEX development.
    If we have say a report region based on a SQL statement, is it better (from a performance perspective) to have the SQL statement defined in the region in APEX OR have the actual select statement executed in the backend and have the result set returned in a type to APEX?
    As an example:
    In APEX region
    SELECT col1, col2, col3 FROM table_aOR
    In APEX region
    select col1, col2, col3 from TABLE(CAST(<my package>.<my proceduere > AS <my type >)) ;<my package>.<my proceduere > would obviously execute the statement
    SELECT col1, col2, col3 FROM table_ausing dynamic SQL and return the results to APEX in thy type <my type>.
    Apologies if this sounds to be a really stupid thing to ask.
    Kind regards
    Paul

    Denes Kubicek wrote:
    You should use a pipelined function only then when you can't use SQL. Otherwise SQL is the way to go.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    ------------------------------------------------------------------------------thanks Denes... but does it matter if:
    1. The SQL statement is actually defined in the APEX region
    or
    2: The select statement is stored in a packageD function and returned to APEX?
    I seem to recall an article I read stating that it is best for all client applications to call stored procedures and functions rather than have SQL statement embedded in the actual application?
    Kind regards
    Paul

  • Flash builder 4 beta 2 import statement disapper

    I create my own button component under package component. Then I use this component inside a view BookingView under view package.
    I need to import BookingComponent by entering
    import component.BookingButton;
    But every time I change this view, this import statement disapper and I need to re-type it.

    Known bug http://bugs.adobe.com/jira/browse/FB-23179.
    Jason San Jose
    Quality Engineer, Flash Builder

  • Import statement .. what does it do ??

    Hi All,
    What is IMPORT statement doing ??
    IMPORT order_items_in to w_order_items_in from MEMORY ID
    'FREEGOODSTERMS'.
    can you kindly explain what this statement is doing ?
    I was by my friend that this is used to pass order_items from one session to this sesssion, but when I searched for FREEGOODSTERMS, I could find export after this statment. I was wondering how can import me first and then export.
    Please let me know.
    Thanks
    venkat.

    Hello Venkat,
    Sorry for late reply..
    Please see the program which other program submitting somewhere.
    if they are using multiple purpose then export and import statement may possible in one include.
    Best way just use where used list for that include and other programs searching like export and submit..
    For better understanding about export and import then see the below sample programs.
    Create one program and paste below code :
    REPORT  ZTEST_AMEM1.
    tables : lfa1.
    data : begin of i_lfa1 occurs 0 ,
           lifnr like lfa1-lifnr,
           name1 like lfa1-name1,
           land1 like lfa1-land1,
           end of i_lfa1.
    start-of-selection.
    select lifnr
           name1
           land1 from lfa1
           into table i_lfa1 up to 100 rows.
    Export
    export i_lfa1 to memory id 'SAP'.
    submit ztest_amem2 and return.
    write:/ 'hello'.
    Now create one more program  and paste below code :
    REPORT  ZTEST_AMEM2.
    data : begin of j_lfa1 occurs 0,
           lifnr like lfa1-lifnr,
           name1 like lfa1-name1,
           land1 like lfa1-land1,
           end of j_lfa1.
    start-of-selection.
    import i_lfa1 to j_lfa1 from memory id 'SAP'.
    loop at j_lfa1.
    write:/ j_lfa1-lifnr,j_lfa1-name1,j_lfa1-land1.
    endloop.
    Thanks
    Seshu

  • Which is better to use: BEx query or Web Application as an iView in portal?

    Hi gurus!
    Are there any experienced opinions, which is better - publish a BEx query in portal or publish a BEx Web Application in portal? Is it easier to alter the layout attributes etc. if I create a BEx Web Application first before publishing?
    What is the way of fixing for example filter item height if I publish BEx query in portal - is there a Web Application that it uses anyhow which I can fix? Or can I use in that case iView -properties in portal?
    Thankful for advice
    Sari

    ok, means i can use jsp:useBean tag for all my
    classes that are not actually bean. so it will be
    instantiated at run time and provide efficiency .No. Jsp:useBean is used for java bean components.
    >
    but when should i use import statement in my jsp and
    it happen at translation time so will it create any
    type of burden for my code if i import multiple
    classes.For non-java beans, you need to import the classes, period.
    It's not a burden, it's a necessity.

  • Import statement question

    what's the difference between
    import java.util.Vector;
    and
    import java.util.*;
    is there any difference in bytecode generated? or time takes to compile?
    what's the best practice?

    Yes there is a best practice, it's the one you mentioned. Use the more specific import statement. If you're only using one or two classes from a package, explicitly name them in the import statements. That way somebody else reading your code (which includes yourself, six months later) can immediately get a better understanding of your code.
    If this rule is followed, and you see this as the first line of a source file:
    import java.util.StringTokenizer;
    then you know the StringTokenizer is being used. But if you saw this:
    import java.util.*;
    you wouldn't know which one is being used until you're deep in the code.
    Knowing right away whether a class is tokening a string, versus say using collections, makes it a lot easier to read.
    You should only use the whole-package include if you're importing a really big part of the package. For example:
    import java.awt.*;
    is probably OK because it's relatively unlikely a person will use only a couple classes from that package.

  • Refurb 13inch 2012 OR Refurb 15inch 2011 which is better?Is refurb really worth it?THOUGHTS ON REFURBISHED MBP

    hey folks i am planing to buy a macbook pro after saving cash since the past 6years i want you all to help me with which product i should go for
    i am 17 and need a good laptop which will last me another 5years..... i have been thinking about a refurb macbook pro 2012 13inch 2.9 i7dual core which is for about 1260 and another one refurb macbook pro 2011 15inch 2.2  i7 quad core which is again for 1350.....i would want to know which is a better option as price wise both are very close and if is the 15inch worth it and better as the 2011 does not have the usb3.0 and bluetooth 4.0 and its sandy bridge but again its quad core where as the 13inch 2012 has all the stuff but its dual core.... what is the difference between quad and dual core?....and i would want to know your thoughts on the refurb models as i said its importamt for me to spend my money wisely since i have been saving for the past 6years....does the refurb mbp as good as new?can they have cosmetic damages?is the outter shell and body replaced?and do they come with new parts and accesories? and is it like a second hand laptop which is used for a year or few months and then returnded and sold again as refurb? please let me know which is better and long lasting or else shall i go for a new one...cause if i buy a refurb mbp and the apple protection care plan the total cost is as much as a new mbp so is it better to buy a new mbp and not buy the apple protection  plan? PLEASE HELP ME OUT
    Thanks for your time
    Toodles
    Links of the models:
    http://store.apple.com/us/product/FD318LL/A/refurbished-macbook-pro-22ghz-quad-c ore-intel-i7#overview
    http://store.apple.com/us/product/FD102LL/A/refurbished-macbook-pro-29ghz-dual-c ore-intel-i7
    ps: is a 128gb solid state drive worth replacing the 500gb or 750gb serial ata

    USB 3 vs USB 2 -> the importance of USB 3 depends on how much you use an external drive to read/write large files or large numbers of files. I once did extensive testing with USB 2 vs FireWire 400 & 800 with TimeMachine. It was no surprise that performing a complete backup with FireWire was significantly faster than with USB (or even a large backup such as after installing an OS update). But for those hourly (or even daily) backups the difference wasn't all that significant. Exporting a large number of photos or an iMovie to FireWire was significantly faster. Copying a copy word processor files it was almost impossible to accurate time the difference. For some the USB3 ports are a big deal. For me, not at all because I'm heavily invested in FireWire drives.
    BlueTooth 4? Frankly, I can't say because the only thing I use BT for is my keyboard and mouse which the older standard is fine for. There are potential advantages - just as with USB3 - the question is whether your current/future needs align to the new standards. Again for me they don't.
    As for the CPU difference - I've already indicated that unless you are doing high processor intensive work (such as 3D modelling or big statistical modeling) either processor has plenty of power. According to the benchmarks my new work iMac runs rings around my work 2009 Core 2 Duo 13" MBP. In my real world use of those two computers I never notice the difference. If I played 3D games on them I would.
    I've already said that all but one of my refurbs looked new and from what I've seen of relatives and friends buying refurbs that runs pretty true. You aren't buying a new computer but on the other hand I've never seen a refurb that looked beat up. Most refurbs are computers that buyers returned within Apple's 14 day buyer's remorse period or were dead on arrival, a new one given to the buyer, and repaired.
    I can't tell you how long a refurb MBP will last - no more than I can tell you how long a new MBP will last. But Apple warrants them for a year and lets you buy an extended warranty just as if they were new. That indicates the confidence Apple has in its refurbs.
    Where do you get the idea that you can only put a 128GB SSD in a 13"? It can handle any standard 2.5" drive and there are plenty of SSDs in that form factor at 256GB and above. Yes an SSD is expensive compared to a standard drive but the speed increase is amazing and not just in booting up the computer. Installing an SSD on my 4.5 year old iMac gave it another year of live. Installing one in my work MBP was like getting a new computer. I wouldn't consider buying a new computer without one.

  • In session and call tansaction methods, which is better . why?

    hi
    in session and call tansaction methods, which is better . why?

    see the link:
    <a href="http://www.itcserver.com/blog/2006/06/30/batch-input-vs-call-transaction/">batch inpunt VS call transaction</a>
    "The most important aspects of the session interface are:
    <b>Asynchronous processing</b>
    Transfer data for multiple transactions
    Synchronous database update. During processing, no transaction is started until the previous transaction has been written to the database.
    A batch input processing log is generated for each session
    Sessions cannot be generated in parallel. The batch input program must not open a session until it has closed the preceding session.
    The most important features of CALL TRANSACTION USING are:
    <b>Synchronous processing</b>
    Transfer of data from an individual transaction each time the statement CALL TRANSACTION USING is called
    You can update the database both synchronously and asynchronously. The program specifies the update type.
    Separate LUW (Logical Units of Work) for the transaction. The system executes a database commit immediately before and after the CALL TRANSACTION USING statement.
    No batch input processing log"
    I hope I have been able to help you.
    cordial greetings.

  • IMPORT Statement Issue (Internal Table)

    Hi All,
    I am using an IMPORT statement to get all the data from other report's internal table. Now whenever this (the other report's internal table) is changed (for field addition, etc), my report throws a dump. Hence, everytime I have to add these fields in my program as well.
    Is there any way by which I can include the whole internal table of that report in my program just like
    'INCLUDE STRUCTURE VBRK'.
    Thanks in advance

    Hi, CHeck this code related to your problem..This will helpful to you...
    I have done this program earlier..I hope it will helpful to u..
    This programa calling the other program to import the data..
    Check it out...
    *" Tables declarations.................................................
    TABLES:
      spfli.
    *" Type declarations...................................................
    Type declaration of the structure to hold data from table SPFLI     *
    TYPES:
      BEGIN OF type_s_spfli,
        carrid LIKE spfli-carrid,          " Carrier Id
        connid LIKE spfli-connid,          " Connection Number
        cityfrom LIKE spfli-cityfrom,      " City from
        cityto LIKE spfli-cityto,          " City to
        airpfrom LIKE spfli-airpfrom,      " Airport from
        airpto LIKE spfli-airpto,          " Airport to
        countryfr LIKE spfli-countryfr,    " Country from
        countryto LIKE spfli-countryto,    " Country to
      END OF type_s_spfli.
    Data Declaration...................................................*
         Field String To Hold Flight Details Record from SPFLI          *
    DATA
      fs_spfli TYPE type_s_spfli.
    Data Declaration...................................................*
         Internal Table To Hold Flight Details Records from SPFLI       *
    DATA
      t_spfli LIKE STANDARD TABLE OF fs_spfli.
    TYPES:
      BEGIN OF types_s_itab,
        carrid LIKE sflight-carrid,        " Carrier id
        connid LIKE sflight-connid,        " Connection number
        fldate LIKE sflight-fldate,        " Flight date
      END OF types_s_itab.
    Data Declaration...................................................*
         Field String To Hold Flight Details Record from SFLIGHT        *
    DATA
      fs_itab TYPE types_s_itab.
    Data Declaration...................................................*
         Internal Table To Hold Flight Details Records from SFLIGHT     *
    DATA
      t_itab LIKE STANDARD TABLE OF fs_itab.
    *" Type declarations...................................................
    Type declaration of the structure to hold data from table SBOOK     *
    TYPES:
    BEGIN OF type_s_sbook,
       carrid LIKE sbook-carrid,           " Carrier Id
       connid LIKE sbook-connid,           " Connection Number
       fldate LIKE sbook-fldate,           " Flight date
       bookid LIKE sbook-bookid,           " Booking number
       loccuram LIKE sbook-loccuram,       " Local currency
       loccurkey LIKE sbook-loccurkey,
       order_date LIKE sbook-order_date,   " Booking date
    END OF type_s_sbook.
    Data Declaration...................................................*
         Field String To Hold Flight Details Record from BOOK           *
    DATA
      fs_sbook TYPE type_s_sbook.
    Data Declaration...................................................*
         Internal Table To Hold Flight Details Records from SBOOK       *
    DATA
      t_sbook LIKE STANDARD TABLE OF fs_sbook.
    DATA
      w_checkbox.                          " Checkbox
    SELECT-OPTIONS:
      s_carr FOR spfli-carrid.             " Carrier id range
                          START-OF-SELECTION EVENT                      *
    START-OF-SELECTION.
      PERFORM selectq.
                          END-OF-SELECTION EVENT                        *
    END-OF-SELECTION.
      SET PF-STATUS 'YH1314_030502'.
      PERFORM display_basic.
    AT USER-COMMAND.
      PERFORM ucomm.
    *&    Form  selectq
        This subroutine retreive data from SPFLI table
      There are no interface parameters to be passed to this subroutine.
    FORM selectq .
      SELECT carrid                        " Carrier id
             connid                        " Connection number
             cityfrom                      " City from
             cityto                        " City to
             airpfrom                      " Airport from
             airpto                        " Airport to
             countryfr                     " Country from
             countryto                     " Country to
             INTO CORRESPONDING FIELDS OF TABLE t_spfli
             FROM spfli
             WHERE carrid IN s_carr.
    ENDFORM.                               " Selectq
    *&      Form  display_basic
        This subroutine displays data from internal table
      There are no interface parameters to be passed to this subroutine.
    FORM display_basic .
      LOOP AT t_spfli INTO fs_spfli.
        WRITE:
          / w_checkbox AS CHECKBOX,
            fs_spfli-carrid,
            fs_spfli-connid,
            fs_spfli-cityfrom,
            fs_spfli-cityto,
            fs_spfli-airpfrom,
            fs_spfli-airpto,
            fs_spfli-countryfr,
            fs_spfli-countryto.
      ENDLOOP.                             " LOOP AT T-SPFLI INTO...
    ENDFORM.                               " Display_basic
    *&      Form  UCOMM
      This subroutine for at user-command event
      There are no interface parameters to be passed to this subroutine.
    FORM ucomm .
      RANGES :
        r_carr FOR spfli-carrid,
        r_conn FOR spfli-connid,
        r_carrid FOR sflight-carrid,
        r_connid FOR sflight-connid,
        r_fldate FOR sflight-fldate.
      CASE sy-ucomm.
        WHEN 'DISPLAY'.
          DATA:
            lw_lines TYPE i,
            lw_lineno TYPE i VALUE 3.
          DESCRIBE TABLE t_spfli LINES lw_lines.
          DO lw_lines TIMES.
            READ LINE lw_lineno FIELD
                 VALUE w_checkbox   INTO w_checkbox
                       fs_spfli-carrid INTO  fs_spfli-carrid
                       fs_spfli-connid INTO  fs_spfli-connid.
            IF sy-subrc = 0.
              IF w_checkbox = 'X'.
                r_carr-sign = 'I'.
                r_carr-option = 'EQ'.
                r_carr-low = fs_spfli-carrid.
                APPEND r_carr.
                r_conn-sign = 'I'.
                r_conn-option = 'EQ'.
                r_conn-low = fs_spfli-connid.
                APPEND r_conn.
              ENDIF.                       " IF W_CHECKBOX = 'X'
            ENDIF.                         " IF SY-SUBRC = 0
            ADD 1 TO lw_lineno.
          ENDDO.                           " DO LW_LINES TIMES
          SUBMIT yh1314_030502_call
            WITH s_carr IN r_carr
            WITH s_conn IN r_conn
             AND RETURN.
          IMPORT t_itab FROM MEMORY ID 'YH1314'.
          LOOP AT t_itab INTO fs_itab.
            r_carrid-sign = 'I'.
            r_carrid-option = 'EQ'.
            r_carrid-low = fs_itab-carrid.
            APPEND r_carrid.
            r_connid-sign = 'I'.
            r_connid-option = 'EQ'.
            r_connid-low = fs_itab-connid.
            APPEND r_connid.
            r_fldate-sign = 'I'.
            r_fldate-option = 'EQ'.
            r_fldate-low = fs_itab-fldate.
            APPEND r_fldate.
          ENDLOOP.                         " LOOP AT T_ITAB INTO.....
          SELECT carrid                    " Carriee Id
                 connid                    " Connection number
                 fldate                    " Flight date
                 bookid                    " Booking number
                 loccuram                  " Local Currency
                 order_date                " Booking date
             INTO CORRESPONDING FIELDS OF TABLE t_sbook
             FROM sbook
             WHERE carrid IN r_carrid AND
                   connid IN r_connid AND
                   fldate IN r_fldate.
          IF SY-SUBRC NE 0.
            MESSAGE 'NO RECORDS FOUND'(006) TYPE 'S'.
          ENDIF.                           " IF SY-SUBRC NE 0
          LOOP AT t_sbook INTO fs_sbook.
            AT FIRST.
              WRITE: /5 'Carrier Id'(001),
                     20 'Conn Id'(002),
                     35 'Flight date'(003),
                     50 'Book Id'(004),
                     65 'Local Currency'(005).
            ENDAT.                         " AT FIRST
            WRITE: /5 fs_sbook-carrid,
                   20 fs_sbook-connid,
                   35 fs_sbook-fldate,
                   50 fs_sbook-bookid,
                   65 fs_sbook-loccuram CURRENCY fs_sbook-loccurkey.
          ENDLOOP.                         " LOOP AT T_SBOOK INTO.....
      ENDCASE.                             " CASE SY-UCOMM
    ENDFORM.                               " UCOMM
    Regards
    Kiran

  • Import statement is not working

    hi everybody,
    I have a directory under which I have a number of sub-directories. Lets call this directory "parent_directory". under this directory I have another directory called "child_1". Under "child_1" I have another subdirectory called "child_2". Now I have a code in child_2 that has the following statement:
    import program_1;
    //this is a program present in the parent directory. lets call it
    //program_1.java
    when I am compiling I am getting an error saying:
    program_2.java:28: '.' expected
    import program_1;
    ^
    1 error
    program_2.java is the program present in child_2 in which I have included the import statement.
    If I change the ";" to "." then again error appears as the import statement only needs the name of the class and doesnot need the extension.
    I will be very grateful to you if you could please suggest me a way around this.

    This questions belongs in the "New to Java" forum ...
    sigh
    Anyways, import works on package names with trailing * or full qualified class names, e.g.import mypackage1.*; // imports all classes in mypackage1
    import mypackage2.MyClass2; // imports MyClass2 from mypackage2So instead of import program_1; you need to do
    1. ensure that program_1 is in some package
    2. ensure that your directory structure mirrors your package structure (same names!)
    3. ensure that your CLASSPATH is either not set at all or points to the parent dir of your topmost package
    Example:
    Directory structure:C:\tmp\java\top\
    C:\tmp\java\top\MyClass1.java
    C:\tmp\java\top\bottom\
    C:\tmp\java\top\bottom\MyClass2.java
    CLASSPATH=".;<java install dir>\jre\lib\rt.jar;C:\tmp\java"Source for MyClass1.java:package top;
    public class MyClass1 {
    }Source for MyClass2.java:package top.bottom;
    import top.MyClass1;
    public class MyClass2 {
      private MyClass1 myClass1;
    }

  • Import Statement without ID Specification

    There is an import statement
    IMPORT tab g_acc_tab FROM MEMORY.
    While UCChecking it.. it saying that
    import statement without id specification is only used for the sake of r/2 ......
    Can i Comment it ? If so won't my application  go into dump while running on 6.0cc???

    It has to do with packages. Most java classes are in a package, the name of which must conform to its place on the filesystem relative to the classpath. By that I mean that if you have com.mystuff.One.java, it must be in a folder com/mystuff where com is located somewhere in the classpath.
    What you've done is a little different. I'm assuming a couple of things:
    1. you have no package declaration at the top of one.java or two.java
    2. you have the current directory "." in your classpath.
    Java has the concept of the "default package", which covers classes without a declared package, and in your case is the current directory.
    So when you're in c:\sourcefolder and run the compiler, then "."="c:\sourcefolder", and that directory is part of the default package. No import statements are necessary for classes that are in the same package. This is why two.java can call methods in one.java without an import statement.
    When you run your jsp, the "current directory" part of your classpath is not c:\sourcefolder, but some other value (probably the directory you start your jsp engine from) You will have to import all non-java-library classes because the jsp itself becomes a java class, with a package that is determined by the jsp engine.

Maybe you are looking for

  • Rotation of a text 90° as an image ?

    Hi. I know some browsers are not compatible with anything else so far, but it seemed to me that transform: rotate(90deg); was accepted in many browsers http://www.w3.org/TR/css3-2d-transforms/ There's even a polyfill for IE 8 and under- http://canius

  • Will there be a problem if i use DO and connect it to Gnd on 6036E DAQ ?

    I am trying to use DIO channel 0 as digital output(set at 'high' always) and connect it to analog channel 0. I then plan to use gnd to break the circuit. So, analog input will give me 'high' always except when i gnd it. Will i burn up my DAQ card by

  • Cascade update on tables

    Hi, I know that oracle apps coding standard prohibits cascade delete feature in the database. Hence it should be implemented at application level. However my question is regarding cascade update. Need is to update the header's WHO columns, when an up

  • Protege M600 Sound Problem

    Protege M600 Sound ProblemI have reinstall my laptop to windows Xp Sp3, I have try to install sound driver and warning message show: "Cannot Access Volume Control" Could you help me to solve this problem. OS: windows XP sp3 Toshiba Portege M600 Model

  • After installing 10.4.3

    Hi, Before I installing 10.4.3 I ran Repair Disk Permissions and everything was fine, so I installed the update and then ran Repair Disk Permissions again and I have a huge list of permissions. I ran it a few times but I get the same thing. Can anyon