About the default package

We all know , in the java.lang package , we don't import .but I want to know whether I can set a package for example "xxxx" , just as "java.lang " . In the later code, I don't import the xxxx package , it can use the class in the xxxx package ?
Thanks a lot.

No. The fact that public type names declared in the java.lang package are automatically imported is part of the vm spec. So, unless you write your own jvm, I don't think you'll be able to do this.

Similar Messages

  • Netbeans - refactoring from in a package to the default package

    Hello,
    I have a problem, I have some JNI code (two .dll's) and a wrapper that connects my java program to an external USB board.
    I didn't write the original code, that was done by Mike Peter and the dlls have been compiled so that I can call the JNI functions only in the default package. Whenever I try to put the code in a package of its own, the JNIs stop working. So my problem now is that I want to access this interface class from my code that is in a package.
    I don't know how to import the code as a library into my programs package so perhaps a solution might be to de-package my program code so that it can access Mike Peters code.
    Trouble is I have used the netbeans GUI editor that does not let me access all the code and I dont know how to refactor the package from being in one to not being in one.
    removing the package declartion from my code manually causes lots of errors.
    Any ideas?
    Mike Peters code downloadable here:
    http://www.re-applications.be/downloads/J-K8055-Wrapper.zip
    the usb_interface class has no constructor and is not in a package, how do I go about making it a library and importing it?
    I'd greatly appreciate it if anyone can help, if more details are needed I can try to provide them but I didn't think it was worth putting up all my code here as there is no real problem with it, just an access issue.

    What I really need to do is find a way to import a class from the default package.
    I was led to believe that classes in the default package should be readily accessible, however my compiler says otherwise when my code is in a package and the class I want to access can only be accessed when my code is not in a package. This is really frustrating because the GUI editor doesn't like it when the GUI is not in a package... so I either lose and my USB interface doesn't work or I lose and my GUI doesn't work.
    help!

  • Where is the location of the default package?

    I'm using jdk1.6.0_14. There is a folder src. I guess the folder contains all the default package. And I try to delete the src folder, and then compile and run a simple program:
    import java.util.Scanner;
    public class TesImport {
         public static void main(String[] args) {
              Scanner s = new Scanner(System.in);
              System.out.println(s.nextDouble());
    }...but it still work... Actually, where is the location of the default package?
    Really need your help.
    Thanks

    JoachimSauer wrote:
    georgemc wrote:
    Eclipse defaults to thisSince I'm using maven, I really like the default structure of files there:
    - */src/main/java* is for Java sources
    - */src/main/resources* is for resources
    - */src/test/java* is for Java sources for the tests
    - */src/test/resources* is for resources for the tests
    - */target* contains everything produced by the build
    - */target/classes* contains compiled Java classes from /src/main/java and resources from /src/main/resources
    - */target/test-classes* contains compiled Java classes from /src/test/java and resources from /src/test/resourcesMe too. Presumably you use the Maven plugin to generate Eclipse projects too? One of the things Maven-haters moan about is that it enforces it's own directory structure on you, which quite apart from not being not true, isn't a bad thing anyway. That structure is a pretty sensible default

  • How to save library symbols' class files in packages that are not the default package?

    Hi,
    I perform the following in Flash CS5 with Flash Builder 4
    1) Create a new library symbol.
    2) Do a RightClick->Properties on the new symbol
    3) Check the options for "Export for ActionScript" and "Export in frame 1".
    4) I write a new name for my class "Class1" and click on the pencil icon "edit class definition" to edit the class.
    At this point my FlashBuilder 4 takes over and opens the "New ActionScript" dialog.
    4) I then click on Package-Browse to select a package e.g. com.mycompany.myfiles as the new class destination.
    The as file is created as com.mycompany.myfiles/Class1.as as everything seems just fine.
    5) I close the ActionScript file and back in Flash CS5 I RightClick on the symbol and select "Edit Class".
    At this time, FB4 suggests again to create the file, ignoring the fact that I already created it before.
    Do you know of a way I can make Flash CS5 remember where I created the file?
    Thanks.

    Hi,
    I didn't remove the project or delete any of the files.
    All I did was create the class file under a package that is not the default package. Then when I clicked on the Flash symbol's "Edit Class" It asked me again to create the same class file.
    Only if I create the class in the default package, it won't ask me to recreate it again.
    Bye,
      RaamEE-IL

  • What is the default package tu put in a data model ?

    Hi,
    I want to call a procedure *"EXTRACTION"* which is located in the default pachkage of my database.
    What shoud i put in my data model? i feel that this line is wrong :
    *<dataTrigger name="beforeReport" source="Extraction"/>*
    Thnaks,
    SAAD

    Hi,
    i have plaeced my procedure directly in my procedure folder not in a package.
    so if im correct, the default package will be nothing so i just put the name of the procedure.
    is that true?
    Tnaks,
    SAAD.

  • Importing from the "default package"

    Hi,
    I've got a class ("A") which contains an inner class ("Inner") in it, and I have another class ("B") which needs to use the inner class. To make the code more readable I would like to import the inner class directly into class "B", so that I could write something like: "Inner in = ...", instead of "A.Inner in = ...".
    The problem is that all of these classes are placed in the "default package", and Java won't let me import without specifying a package in the import path.
    Is there any way to make a reference to the "default package" and use it inside an import?
    Thanks...

    I think that you should avoid using the default package whenever possible, and in this situation you have to avoid using it. I'm curious, what argument do you have against using packages? Also, why not pull that inner class out if it's to be used by other classes? I think that your code will be more readable and maintainable this way. But then again, I'm kind of new myself, so I'd be interested to hear what others have to say.

  • Information about the default setup for the demo user

    Hi,
    Can anyone guide me the properties which we have to set for the below
    # Information about the default setup for the demo user.
    db.adminUser=system
    db.demoUser=FOD
    db.demoUser.password=fusion
    db.demoUser.tablespace=USERS
    db.demoUser.tempTablespace=TEMP
    And what exactly they represent
    Regards,
    Krishna

    Krishna,
    It's pretty obvious...
    db.adminUser = the username of a dba user in your database
    db.demoUser = the username of the demo user that will get created
    db.demoUser.password = the password that will be used for the demo user
    db.demoUser.tablespace = the default tablespace for the demo user
    db.demoUser.tempTablespace = the default temporary tablespace for the demo user
    You don't have to change any of them.
    John

  • Hesitations about the Default Layouts

    Hi everyone,
    I have some hesitations about the Default Layouts for the High Level Containers.
    Panel : FlowLayout
    Dialog: BorderLayout
    Frame: FlowLayout
    Is this all true ??

    I have some hesitations about the Default Layouts for the High Level ContainersA JPanel is not a high level container. Read the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/components.html]A Visual Index to Swing Components.
    Create a JPanel then use getLayout() and see what is returned.
    Create a JDialog and a JFrame. Then use getContentPane().getLayout() and see what it returned.
    In other words become familiar with the API. As a general rule whenever there is a setXXX() method you will have a related getXXX() method to query the property that was set.

  • Using classes outside of the default package in OATS 12.3.0.1.0

    Hello,
    OpenScript - Version: 12.3.0.1 Build 376.
    The test fails when I use classes that are not in the default package.
    Here is a simple example:
    TempClass - in the default package, I can create new objects and use it's methods without any errors.
    AlienClass - in another package (which name is anotherPackage) of the same project, I import that package into the script.java but I get an exception while creating new class object:
    "An unexpected exception occurred in the script. Script section: Unspecified. Caused by: ClassNotFoundException occured. anotherPackage.AlienClass "
    import anotherPackage.*;
    public void run() throws Exception {
      TempClass tmp = new TempClass(); // no errors while creating
      info(tmp.generateMessage());           // this method works correctly
      AlienClass al = new AlienClass();
      /* here I've got error
      *An unexpected exception occurred in the script.
      * Script section: Unspecified.
      * Caused by: ClassNotFoundException occured. anotherPackage.AlienClass 
    There are no such problems in OpenScript Version: 12.2.0.1 Build 223.
    Could you help me, please?
    Best regards,
    Natalie

    Hi, Sri!
    It was not necessary to name the root package "lib" in previous versions of OpenScript (12.2.0.1, 9.X.X).
    Except the default package, my work project in 12.2.0.1 included one main user package named by the testing application (let's call it "myApp"). And other packages and classes were located there.
    For example:
    D:\Development\TestProject\myApp\core\DB.java
    D:\Development\TestProject\myApp\test\Test1.java
    D:\Development\TestProject\myApp\test\Test2.java
    D:\Development\TestProject\myApp\web\common\Authorization.java
    etc.
    Project with such structure worked in OpenScript 12.2.0.1 but doesn't work in 12.3.0.1.
    According to your advice I created a new package - D:\Development\TestProject\lib, moved "myApp" with all included packages and classes into that package and corrected import statements (like lib.myApp.core.* instead of myApp.core.*).
    And then no errors appeared! So thank you very much! But it's interesting, why behaviour of OpenScript concerning package's name has changed?
    As for example from the first message,  import statement was in the same place where OpenScript added others packages during creating a new project. I've just tried to save some space in the message
    The full script.java is:
    import oracle.oats.scripting.modules.basic.api.*;
    import oracle.oats.scripting.modules.browser.api.*;
    import oracle.oats.scripting.modules.functionalTest.api.*;
    import oracle.oats.scripting.modules.utilities.api.*;
    import oracle.oats.scripting.modules.utilities.api.sql.*;
    import oracle.oats.scripting.modules.utilities.api.xml.*;
    import oracle.oats.scripting.modules.utilities.api.file.*;
    import oracle.oats.scripting.modules.webdom.api.*;
    import oracle.oats.scripting.modules.adf.api.*;
    import anotherPackage.*;
    public class script extends IteratingVUserScript {
      @ScriptService oracle.oats.scripting.modules.utilities.api.UtilitiesService utilities;
      @ScriptService oracle.oats.scripting.modules.browser.api.BrowserService browser;
      @ScriptService oracle.oats.scripting.modules.functionalTest.api.FunctionalTestService ft;
      @ScriptService oracle.oats.scripting.modules.webdom.api.WebDomService web;
      @ScriptService oracle.oats.scripting.modules.adf.api.ADFService adf;
      public void initialize() throws Exception {
      public void run() throws Exception {
      TempClass tmp = new TempClass(); // no errors
      info(tmp.generateMessage());     // this method works correctly
      AlienClass al = new AlienClass();
      /* here I've got error
      *An unexpected exception occurred in the script.
      * Script section: Unspecified.
      * Caused by: ClassNotFoundException occured. anotherPackage.AlienClass 
      public void finish() throws Exception {

  • Makepkg with custom dwm ends up installing the default package!

    I have a directory where I edit the source of dwm and then run 'makepkg -efi' to build and install my own version.
    I have been doing this for quite a while now, and everything worked fine.
    Then a few days ago I installed the default dwm with pacman to show my freind what it looks like without the patches that I've applied.
    I removed it with pacman afterward, but now when I run the pkgbuild in my customized dwm directory, it ends up installign the default package!
    I had to go into the source and do a striaght 'make install' to get my custom binary installed again.
    Does anyone know what's going on?

    Are you sure that you did not miss the  "-e" there once and have re-extracted the original tarball?

  • Questions about the 'filesystem' package

    After reading some recent threads and bug reports about the 'filesystem' package, I have the following questions:
    1. What is the reason for adding systemd-related users and groups to this package? Why not add them using the install script in the systemd package?
    2. Why ship /etc/{shadow,gshadow} files at all? Why not create and manage them by `pwconv`, `grpconv` and such (perhaps by an install script in the shadow package)?
    Last edited by ackalker (2014-06-27 17:12:52)

    I didn't mean the dev ML, arch-general will do just fine. arch-dev-public is read-only fro non-devs and non-TUs.

  • Confused about the default schema

    Hi,
    I am a little bit confused about the schema concept.
    I want to create a new schema called APP and then create several users and roles based on the schema APP. The default schema for the users should be APP achema.
    How can I make the schema APP the default schema for the new users that I am creating?
    I feel that there are some schema design concepts that I have to learn. Is there any resource on the internet that I can read and learn more about oracle schema design best practices?
    Any help would be appreciated,
    Ali

    A schema holds object definitions, and in the case of table & index objects the schema also holds the data.
    A user owns the schema.
    Therefore the user 'owns the definitions (including any functions, procedures, sequences, tabels, etc.)
    Other users may be granted access to some, or all, of the objects in a schema. This is done through the 'GRANT ...' command. For example, consider the following steps:
    1) create user app_owner
    2) create table object test owned by the app_owwner
    3) create user app_user
    4) grant select, update, insert and delete on app_owner's test table to app_user
    5) add synonyms to avoid needing to qualify the table's schema name.
    done as follows:
    oracle@fuzzy:~> sqlplus system
    SQL*Plus: Release 10.2.0.1.0 - Production on Mon Apr 3 20:07:32 2006
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Enter password:
    Connected to:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    Create the app owner userid. Note there is no need to ever log in to that user, even to create tables.
    SQL> create user app_owner
      2  identified by xyz
      3  account lock
      4  quota unlimited on users
      5  default tablespace users
      6  temporary tablespace temp;
    User created.
    Creating objects in a schema can be done by providing the schema name, or by switching schema in newer versions of Oracle
    SQL> create table app_owner.test ( t number );
    Table created.
    Create a userid that will access the table. Set that userid up to access the database and (for future) give it the capability to create it's own synonyms
    SQL> create user app_user
      2  identified by xyz
      3  temporary tablespace temp;
    User created.
    SQL> grant create session to app_user;
    Grant succeeded.
    SQL> grant create synonym to app_user;
    Grant succeeded.
    Now give the user access to the objects
    SQL> grant select, update, insert, delete on app_owner.test to app_user;
    Grant succeeded.
    Let's test it out. Insert by qualifying the schema name on the object, then create a synonym to avoid using schema, and try it all using the synonym
    SQL> connect app_user/xyz
    Connected.
    SQL> insert into app_owner.test values (4);
    1 row created.
    SQL> create synonym test for app_owner.test;
    Synonym created.
    SQL> insert into test values (3);
    1 row created.
    SQL> select * from test;
             T
             4
             3
    SQL>  Note that some people want to use PUBLIC grants and PUBLIC synonyms. This is a real bad idea if you want to ensure long term security of the data and want to host several different applications in the same Oracle instance.
    This, and a whole lot more, is in the 'Concepts' manual for your version of the database at http://docs.oracle.com

  • Question about the HandHeld Package Configuration

    PDA Model - Dell Axim 30 Pocket Pc o/s Windows CE 2003 SE
    ZFH Version - 6.5
    I have configured the handheld package, program section as follows:
    Programs to include on the start menu:
    Pocket Explorer
    Groupwise
    Groupwise Appt
    Groupwise Day
    Groupwise Note
    Groupwise Taks
    Groupwise Week
    Pocket Word
    Pocket Excel
    Pocket Adobe
    THe Move all other Start Menu / Desktop items to the Programs Folder is checked
    The Hide all items in the Programs Folder is checked.
    The way that I interept this is that the programs I noted above will show up on the Start menu and no icons should appear on the programs screen.
    What I get is: The items do show up in the Start Menu as configured, however when I tap on the programs section of the start menu, the 'desktop' icons for Word, Excel and Adobe show up.
    Am I doing something wrong?
    Thanks,
    Cheryl
    Cheryl Fischer
    Network / Email Administrator
    Horizon Bank

    1. First and foremost, my suggestion would be to view the status (and the
    details therein) of the Policy Enforcement on the device.
    {{To do this, follow device_object > Properties > ZENWorks : Policy Status
    tab > Display button > Select the correct row > View button }}
    2. If things seem fine there, browse the following location on your device.
    My Device >> Windows >> Start Menu >> Programs
    Do you see any shortcuts there ? On most devices, this is the location
    where the short-cuts of "Programs" folder are located.
    Do let us know if this folder is empty or not.
    Thanks & Regards
    Anand Sinha
    "Cheryl Fischer" <[email protected]> wrote in message
    news:s_cFd.93$[email protected]..
    > PDA Model - Dell Axim 30 Pocket Pc o/s Windows CE 2003 SE
    >
    > ZFH Version - 6.5
    >
    > I have configured the handheld package, program section as follows:
    >
    > Programs to include on the start menu:
    >
    > Pocket Explorer
    > Groupwise
    > Groupwise Appt
    > Groupwise Day
    > Groupwise Note
    > Groupwise Taks
    > Groupwise Week
    > Pocket Word
    > Pocket Excel
    > Pocket Adobe
    >
    > THe Move all other Start Menu / Desktop items to the Programs Folder is
    checked
    > The Hide all items in the Programs Folder is checked.
    >
    > The way that I interept this is that the programs I noted above will show
    up on the Start menu and no icons should appear on the programs screen.
    >
    > What I get is: The items do show up in the Start Menu as configured,
    however when I tap on the programs section of the start menu, the 'desktop'
    icons for Word, Excel and Adobe show up.
    >
    > Am I doing something wrong?
    >
    > Thanks,
    > Cheryl
    >
    >
    >
    > Cheryl Fischer
    > Network / Email Administrator
    > Horizon Bank
    >
    >
    >

  • Question about the default style of af:inputText in ADF

    Hi all,
    Here's the situation I am facing:
    in the jspx page, I have a <af:inputText inlineStyle="bk_bean.defaultStyle"... onchange="validate(this)"/>
    in the javascript:
    function validate(control){
    // when the input is invalid:
    control.style.backgroundcolor='pink';
    // when the input is valid:
    control.style.backgroundcolor='#FFFFFF';
    because of the above assignment, the border of the <af:inputText> looks like 3D and lost its original look and feel. I need to keep the original border style. What I am thinking is that I will
    assign the default border style after assigning the background. But I don't know what the default border styles for <af:inputText> in ADF. Could someone help me with this? I tried to find one in this URL:
    http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/skin-selectors.html
    but still couldn't see one that look like what I am looking for.
    Your help is highly appreciated!
    Shawn
    P.S. I tried this:
    function validate(control){
    // when the input is invalid:
    control.style.backgroundcolor='pink';
    // when the input is valid:
    control.style.backgroundcolor='#FFFFFF';
    control.style.border-style='solid';
    Not working at all, still had 3D look and feel.
    Edited by: shawn_abc on Feb 4, 2010 5:48 PM

    Hi Prasad,
    Thanks for your reply. I actually tried a similar way using the <style>. The thing is that whenever I set the background, the 'inset' style is applied implicitly. But now we use this: control.style.backgroundColor='' whenever the input is valid, then after correcting the input, the style goes back to whatever the original style. Though the 'inset' style is still applied when backgroundcolor is set when input is incorrect, but we accept that as long as after correcting input, the style goes back to the original style.
    Thanks for all inputs from everyone!
    Shawn

  • I am trying to make a Birthday card for my sons 2nd birthday, and It keeps saying both about the "default text" and now that it wont fit on the paper. but everything seems fine....HELP???

    please help!

    Are you using iPhoto '11 on a Mac?
    Try to print your Card (using the main menu bar "File > Print" or save the printed version to pdf.
    Then you can check, which text still is default. The default text will be missing from your print - see for example the screenshot below. Also you can check the measurements on your printed copy. In the print menu you can use the arrow buttons to step through the pages of your card.
    Regards
    Léonie

Maybe you are looking for