Question about import statement

Hi all!
I was wondering if a line like this:
import java.io.*imports all classes from java.io or just the classes needed by your program (the classes you actually using in your code). Can anyone give me a little hint on that?

The way I understand it is that it simply makes the
classes in that package 'visible'. This means that you
don't have to type the fully qualified name each timeOh, yeah. I was thinking too much in C and it's #include.
Thanks :-)

Similar Messages

  • Question about import statements

    Why is it that I must have the import statement on the
    same frame
    and same layer
    as the AS code that utilizes the Class that I am importing?
    At least that is how it appears.

    Because that is how it works.
    Remember, import doesn't actually "import" anything. It is
    just a shortcut so you don't have to type the whole package name
    every time you use the coded in your example.
    It is actually kind of nice when you come back to code later
    or if you open somebody else's code (that you have to update or
    change) and to see at the top, "Oh, this bit of code has a reliance
    on class blah.blah.Yadda." In a way it kind of helps enforce a bit
    of good coding practice.

  • Newbie question about import statement

    Lets say for example I have a class A and a class B.
    Then lets say I import class A into class B.
    If I instantiate some objects and methods in class A
    Will I be able to access them in class B.
    Thanks gemann

    Imports are used to import classed from another package.
    Conside a package named package1 and class named A in it.
    package package1;
    public class A{
      //public method
      public void publicmethod() {}
      //private method
      private void privatemethod() {}
      //default method
      void defaultmethod(){}
      //protected method
      void portectedmethod(){}
    }Now conside another package named package2 having a class B.. and you want to make an object of class A and want to call its method..
    package package2;
    import  package1.A;  // or import package1.*   it imoprts every class in this package
    class B{
    B(){
    A a=new A() ; // possible since we imported it..
    a.publicmethod() // possible since it is public method
    a.defaultmethod()// Not possible. since it is a this is in a different package
    a.protectedmethod()// Not possible since this is in  a different package, and this is not a derived a derived class of B
    a.privatemethod() // Not possible since it is private
    }Hope it is clear now..
    appu

  • Question about import database pk, fk

    Hi
    I want to ask a question about imported database. I imported database and I noticed tables doesnt have Primary key or foreign key. They havent relation between eachs. Why can this occured ?
    is it about import or another something?

    yeah ı am surprised none of tables have pk or fk ..
    but ı want to show you http://i51.tinypic.com/2hedc9d.jpg
    what is blue shapes in there ?
    can be foerign keys ?

  • Question about delete statement

    I have question about delete statement...
    i am performing some simple delete statement against one table..but its taking so long..How can we check whether particular delete statements actually deleting records or not..?

    Is the associated select-statement returning rows or not?
    If yes -> delete is deleting
    If no -> delete is just using CPU-cycles
    To tune the delete-statement, you have to tune the corresponding select-statement. To tune the select-statement, you want to read the thread When your query takes too long ...

  • Basic question about importing wma files

    Hi, I have a basic question about importing wma files. I ripped some cd's on a Mindows computer using Media Player, but now want to copy them to my Mac and use them in iTunes on my Mac. when I use Import in iTunes, nothing happens and I cant even seem to copy them one by one using the Music folder.
    Can someone help me?
    thanks
    eMac   Mac OS X (10.4.4)  

    iTunes for Mac doesn't support .wma files.
    If you can use a PC to convert them, you can use one of many freeware applications. Google for 'wma to mp3'.
    For the Mac there's the shareware program EasyWMA that can convert them.
    Hope this helps.
    M
    17' iMac fp 800 MHz 768 MB RAM   Mac OS X (10.3.9)   Several ext. HD (backup and data)

  • Some questions about importing HTML files

    Hi, folks
    Let's suppose we want to import a pack of HTML files formatted in HTML5 wit's it's CSS into a double-oriented folio. A couple or three questions about that, please:
    1. Is there a limit for a reasonable quantity of HTML files I can import into a folio? I mean.. 100 would be way too much, for instance?
    2. These HTML files could be navigated and referenced from inside TOC-pages made in InDesign,right? (navto://..., I gues?)
    2. Will it be possible, by means of HTML adaptative design techniques, to treat both orientations (vertical and horizontal) as different viewports or screen sizes so that the design adapts for instance the column width with its CSS?
    3. That said, will the InDesign final app. respect that adaptative CSS rules?
    I am asking this because we are looking for a way to inject big quantities of content with a very similar design into our application in a really fast and automatizable way and I have the suspicion* that importing HTML5 preformated CSS files could be the a very good and simple alternative to importing XML into InDesign templates as we start out content as tagged almost-html files.
    Thanks a lot
    Gustavo Sánchez (Posting from Madrid)

    I assume you are asking about using HTML articles.
    1. There is no limit beyond simply keeping things reasonable.
    2. Yes. Just use navto://articlename
    3. Yes. I've used min-width of 768 and max width of 1024 to control it.
    4. InDesign does not enter into any of this with the exception of using the folio builder panel. Everything else is done in Dreamweaver or whatever program you decide to use for the article.
    If you want to restrict the HTML articles to one orientation or the other, use the _h and _v suffixes.
    Bob

  • Concept about  import statements

    Hi all,
    I write a GUI application and I notice I have to write these two import statement at the same time in order to handle the events:
    import java.awt.*;
    import java.awt.event.*;
    Why is that? Does java.awt.* not include java.awt.event.*?
    thank you,
    Li

    I'm unsure what you are talking about...do you mean something like this?
    import java.util.LinkedList;
    import java.util.concurrent.*;-or- perhaps something like:
    import java.util.*;
    import java.util.LinkedList;In the case of the former, that is perfectly legal and possible. In the case of the latter, it is possible, but absurd. Perhaps neither of these were what you were talking about. If not, let me know more precisely what you mean and we'll see about it.

  • Some questions on import statements.

    When I see
    import java.awt.*
    import java.awt.event.*
    am I on track interpreting this to mean that you want to be able to use any of the classes found in package java.awt?
    why would import java.awt.event.* be necessary if event is a class in the java.awt.* package you're importing in the second import statement up above?
    does * mean like a "wildcard" which allows you to utilize
    anything that is part of java.awt?

    It allows you to use any of the classes in that directory, but not any classes in sub-directories of that directory.

  • Question about 'write' statement

    Hi,
    A question on write statement.
    I have a internal table itab which has field var. I am looping at this itab and writing horizontal heading output like below.
    example on the output heading:
    (3 spaces) itab-var (20 spaces) itab-var (20 spaces) itab-var.
    the coding is:
    loop at itab.
    write: 3 itab-var.
    endloop.
    I want to increase the space by 20 for every loop. How to increase this 3 by 20? Can we accomplish this way?
    Thank you for your time.

    hi krishen,
    just add 20 inside the loop , so that after every loop its value increases by 20
    for example:
    data: v  type i.
    v=3.
    do 3 times.
    write: at v(20).
    v=v+20.
    end do.
    hope it will help you
    regards
    Rahul sharma
    Edited by: RAHUL SHARMA on Sep 4, 2008 7:47 AM

  • A question About SUBMIT statement

    Hi,
    By SUBMIT statement, i can trigger another report. If the called report runs into dump, how can i detech/catch the dump in the calling report? I tested. It seems impossible to catch the dump. The calling report will also dump.
    My question is, if the called report runs into dump, how to detect the dump and avoid dump in calling report?
    Thanks in advance,
    Best Regards, Johnney.

    hi
    you can catch this kind of error or exeption from the respective report
    then pass this error or exeception to the calling report
    go through the  example I  am giving , ti have done it like this only  
    SUBMIT zgurep03 AND RETURN WITH SELECTION-TABLE li_seltab .
    then in the called reprot
    *Check ledger
      SELECT SINGLE * FROM t881 WHERE rldnr = p_rldnr.
      IF sy-subrc NE 0.
        SET CURSOR FIELD 'P_RLDNR'.
         MESSAGE e448 WITH p_rldnr
          MESSAGE e446 INTO lv_text .
          lv_type = 'E'.
    Capturing the error messages.
    EXPORT lv_text TO MEMORY ID 'TX'(004).
    EXPORT lv_type TO MEMORY ID 'TP'(005).
    in calling report
      IMPORT gv_type1 TO gv_type FROM MEMORY  ID 'TP'.
      IMPORT gv_text1 TO gv_text FROM MEMORY ID 'TX'.
    preparing error message in the callge report for the calling report
    PERFORM prepare_message
            USING sy-msgid
                  lv_msgno
                  lv_msgv1
                  lv_msgv2
                  lv_msgv3
                  lv_msgv4
            CHANGING gv_text.
    preparing  error message
    FORM prepare_message  USING    p_sy_msgid
                                   p_sy_msgno
                                   p_sy_msgv1
                                   p_sy_msgv2
                                   p_sy_msgv3
                                   p_sy_msgv4
                          CHANGING p_gv_text.
      CALL FUNCTION 'FORMAT_MESSAGE'
        EXPORTING
          id        = p_sy_msgid
          lang      = 'EN'
          no        = p_sy_msgno
          v1        = p_sy_msgv1
          v2        = p_sy_msgv2
          v3        = p_sy_msgv3
          v4        = p_sy_msgv4
        IMPORTING
          msg       = gv_text
        EXCEPTIONS
          not_found = 1
          OTHERS    = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    I guess this will solve your problem
    Regards
    Prashant

  • Question about import in archive log mode

    Hello.
    I am a developer, I have ordered to write a script that makes the import of a schema of a database (release 9.2.0.7). That import will be done once a day. I have seen that in my development environment the import creates 54 archivers files (10M aprox. each), that means more that half a Gb a day, it seems too much to me.
    I cannot see why all those archivers can be useful. Would a good way of proceeding the following?
    1. Forcing an archiver just before the import (I do not know how to do that) so that a backup could be done to the state before the import.
    2. Disabling archive log mode during the import and enabling it just after the import (I do not know how to do that).
    3. Forcing a new archiver just after the import (I do not know how to do that).
    Thanks in advance.

    540M is not that much.
    One would question why you need to import every day,
    there must be better ways to do this.
    The three steps you propose look like an awful
    scenario, as it would require the database to switch
    from archivelog to noarchivelog and vice versa.
    This would require the database to close twice a
    day.
    The scenario is also incomplete as one would need to
    take a backup after the import
    If you can convince your DBA to close the database
    twice a day, he should write the script, which he can
    easily derive from the docs.
    But likely he will visit Billy Verreynne to borrow
    his lead pipe, and rightly so ;)
    Sybrand Bakker
    Senior Oracle DBAThanks for the answer.
    A few things:
    - Sorry for my ignorance, I have no experience in database backups, I do not understand why I need to backup just after the import.
    - That database is not critical, it is just for a team who will test on that database several applications, so the database will only need to be open during the office schedule.
    - I have no dba. The client has a dba for several databases but I have no contact with him/her nor my boss has.

  • Question about conversational state of Stateless bean....

    Hello all,
    I have a simple stateless bean which parses an XML file and stores the xml content as an list of 2-D arrays in member variables. Here is quick look at design...
    import javax.ejb.Stateless;
    // included other libraries
    import java.util.List;
    import java.util.ArrayList;
    @Stateless
    public class XMLParseBean implements XMLParseBeanInterface {
        public List<String> strParameters;
        public List<String> getStrParameters() {
            return strParameters;
        private void setStrParameters(List<String> strParameters) {
            this.strParameters = strParameters;
        public void parseXML(String strFileName) {
               /* Open the XML file and do initializations for xml parsing here
                setStrParameters(visitNode(doc.getDocumentElement()));
        private List<String> visitNode(Element thisNode) {
                /* Parse the XML here */
                return strNodes; // return the node names and their values
    }My question is : if I inject this bean in another bean, call the method for parsing XML and then call the getParameter method to access the value of member variable, will it work.
    I mean since I am using stateless bean, does the conversation state end when the parseXML method ends?

    sir_edward wrote:
    Hi vikram8jp,
    The session of an stateless bean ends after a method call. If you call a method of your bean, the bean will forget all attributes when the method ends. If you want to save attributes, you have to use a stateful bean.
    Regards
    Sir EdwardHello Sir Edward,
    That answers my query.

  • Java Newbie Question - the import statement

    Hi Geeks,
    I have a problem for importing a java .class in my project. This latter is named "Tedetis_New". Inside it, I created a "src" folder containing all the source code of the application. I import a jar file inside the parent directory of "src" (i.e. at the root of the project). Inside this jar archive, two classes (.class files) are not placed inside a package (default package according to eclipse), let's name one toto.class. So when I want to import toto.class from a file inside the src directory I simply do "import toto.class" but this statement doesn't work ! I don't manage to import my toto.class so ... what do you propose for this ?
    Thanks.

    Don't use the "default" class for anything serious;
    you can't import such a class.Er, package maybe?Yes, I was editing my reply while you replied to my reply so I couldn't
    edit my little blooper in my reply anymore; thank you very much Sir ;-)
    kind regards,
    JosI entered that response as quickly as I could, for just that reason. I
    thought you might notice and try to correct it, and I wanted to preserve
    your fuckupus maximus for all eternity.
    Everyone gather round and taunt Jos! Wave your private parts at his
    auntie! Fart in his general direction!
    Now, aren't you glad you didn't say "Jehovah"?I already knew that you were the one who invented amiability ;-)
    kind regards,
    Jehov^H^H^H^Hos

  • Explain about import statement..

    Hi All,
    what is happening for the below code, pls explain.
      import mdpsx release_9400 block_9400 upd_mro_9400 route_9400 mdvux
          from database indx(zb) id indx_key.
    below is the information
    mdpsx - Internaltable
    release_9400 - Internaltable
    block_9400 - Internaltable
    upd_mro_9400 - Internaltable
    route_9400 - Internaltable
    mdvux - Internaltable
    indx - Database Table
    indx_key is the structure and have the below files in that structure:
    matnr like matvp-matnr
    werks like matvp-werks
    subbu.

    hi
    you wrote..
    >
    subbu ilam wrote:
    > what is happening for the below code, pls explain.
    >
    >
    >   import mdpsx release_9400 block_9400 upd_mro_9400 route_9400 mdvux
    >       from database indx(zb) id indx_key.
    >
    > below is the information
    >
    > mdpsx - Internaltable
    > release_9400 - Internaltable
    > block_9400 - Internaltable
    > upd_mro_9400 - Internaltable
    > route_9400 - Internaltable
    > mdvux - Internaltable
    > indx - Database Table
    >
    > indx_key is the structure and have the below files in that structure:
    >
    > matnr like matvp-matnr
    > werks like matvp-werks
    >
    >
    > subbu.
    NOTE :-IMPORT nad EXPORT is use to importing exporting data to or from the ABAP memory
    import mdpsx release_9400 block_9400 upd_mro_9400 route_9400 mdvux
         from database indx(zb) id indx_key.
    in the above statement mdpsx release_9400 block_9400 upd_mro_9400 route_9400 mdvux is import from the from the ABAP memory database indx(zb)
    hope this helps
    Regards
    Ritesh

Maybe you are looking for

  • Premiere Pro CC 2014 and Media Encoder CC 2014 not completing encode.

    This is a project that I have been successfully encoding in short segments until now.  Now when encoding, session runs about 10-15 minutes and then ends without error messages.  Removing effects and changing to Mercury PB Engine SW did not help.  Als

  • Ps elements 5.0 freezes at "scanning for plugins"

    I have photoshop elements 5.0, and have had no problems with it for the past couple years that I've had it until now. Each time I open the program, it freezes, and it says that it is "scanning for plugins". I'm using it on windows vista. I tried unin

  • Random Crashing

    I bought my Macbook at the beggining of the summer. thiis is my fourth Mac and this is the only one I've had trouble with. It has lately been shutting down for no reason. I read other posts and they said to reset the PRAM after upgrading to 10.4.8 so

  • Conditional Region - Advanced Tab Editing

    I'm looking to add XML to a Conditional Region's Advanced tab. i've already filled out the Properties tab with one condition, but want to add another. What is the code context I need to enter? I've searched everywhere with no success. Currently my Ad

  • MBP 2011 keeps freezing after a terrible incident.

    Okay, so today while I was walking, my laptop bag accidentally bumped into a wall. It was not a hard hit, yet hard enough for me to notice it. Afterwards I used the computer for studying, only using Chrome and Word. Later this evening I used it again