How to import a class, which is not in a package?

Hi all,
I have the following problem:
A class A is not in a package. In another class B, which is in a package (let's say package X) I want to use the class A. Without importing the class A, I get the error "Cannot resolve symbol".
Using the import statement import A; gives the error ". expected".
How can I import that class?
Best wishes to all ...
Heiko

> I have the following problem:
A class A is not in a package. In another class B,
which is in a package (let's say package X) I want to
use the class A. Without importing the class A, I get
the error "Cannot resolve symbol".
I think not putting a class in a package is a bad practice. Avoid that.

Similar Messages

  • How to import a class not in the package from a package

    how to import a class not in the package from a package?

    http://java.sun.com/docs/books/tutorial/java/interpack/usepkgs.html

  • How to import a table which is in mdb file(same table in different mdb's)

    Hello,
    how to import a table which is in mdb file(same table in different mdb's)
    e.g. table 'EMPLOYEE' is in 'test.mdb' the same table 'EMPLOYEE' is in 'current.mdb'
    How this can be done on click of a button on my form if the path of mdb is provided?
    Thanks

    This question is not related with ora dev forms, its about Microsoft Access.
    Use import option (File >> Get External Data >> Import)
    or use TransferDatabase action.

  • How to import java Classes in report Builder 10g

    How to import java Classes in report Builder 10g .....
    Arshad

    Hello,
    To import the Java classes:
    Add your jar in the REPORTS_CLASSPATH
    Launch Reports Builder.
    Note:
    You must launch Reports Builder now so that the new REPORTS_CLASSPATH is used.
    Choose Program > Import Java Classes to display the Import Java Classes dialog box.
    Regards

  • How to import other class in Flex Builder2?

    I use Flex Builder2,I want to import the other class,such as
    ascb,like follows:
    package {
    import flash.display.Sprite;
    import ascb.units.Converter;
    import ascb.units.Unit;
    import flash.events.Event;
    public class ApplicationExample extends Sprite {
    private var _square:Sprite;
    private var _angle:uint;
    public function ApplicationExample() {
    _square=new Sprite();
    _square.graphics.lineStyle(0);
    _square.graphics.drawCircle(0,0,2);
    addChild(_square);
    _angle=0;
    addEventListener(Event.ENTER_FRAME,move);
    private function move(event:Event):void{
    var
    converter:Converter=Unit.DEGREE.getConverterTo(Unit.DADIAN);
    var angleRadians:Number=converter.convert(_angle);
    _square.x=Math.cos(angleRadians)*100+200;
    _square.y=Math.sin(angleRadians)*100+200;
    _angle++;
    ApplicationExample.as is locate in direcotry C:\workspace,and
    I put package ascb into directory C:\workspace too,then I run
    ApplicationExample.as ,it raise following error:
    Description:A file found in a source-path must have an
    externally visible definition. If a definition in the file is meant
    to be externally visible, please put the definition in a package.
    Resource:Converter.as
    In Folder:ApplicationExample/ascb/units
    Location:line -1
    By the way,when I write import ascb.,it should show units,but
    it only show util, I guess I may put package ascb into wrong
    director,or the ascb don't put the route of Flex Builder2. I don't
    know how to do it!
    Please give me detail steps to solve above error!
    Thanks in advance!

    when I put as
    import a;
    while compiling, it prompt : '.' expected
    how to resolve it?
    thanksIn J2SDK 1.4, you can only import a class that is in a named package. The compiler is expecting a package_name.class_name;
    You do not need to import classes that are in the same package and all classes that do not specify a package name are in the same unnamed package. However you must import classes that are in different packages.

  • How can i send videoes which are not in camera roll via whatss app to others ?

    hi,
    I am going to know that how can i transfer video which are not in camera roll via whatss app to others ?
    thnaks in advanced.

    Where are the videos?
    If WhatsApp supports sending videos from the Camera Roll only and that is your only option, that is it.
    Contact WhatsApp. They have a website.

  • How to import a class that have no package

    I have .class archive that i need to use in a web aplication on Tomcat. I put the class in the directory: <webapp>/WEB-INF/classes/.
    The class doesn�t have a package, so when i tried to import (..page Import=".....") it, tomcat gave me an error because is looking for a package instead of the class.
    then i try to use it without the import and tomcat gave another error because it can�t find the class.
    Any ideas??
    by the way.. I don�t have the source code, I just have the .class archive..
    thank you....

    Also, I already found that the class had no package. Then you are out of luck.
    As of java 1.4 you can no longer import classes that are not in a package. [url http://bugs.sun.com/bugdatabase/view_bug.do;jsessionid=c85f07c1ce8f344d787b7a5146d68:WuuT?bug_id=4361575 ] Full details here
    The only solutions I can think of
    1 - get the people who originally gave you the class to package it properly.
    2 - Decompile it to java code, Change the java code to put it in a package and recompile it. Depending on the complexity of the class this may or may not be a trivial operation.
    Good luck,
    evnafets

  • How to import outer classes into package inner classes?

    Hi, hope you all under stand my question. Sample as below:
    import A.*;
    public class ClassA{
        public ClassA{
            ClassB.CA = this;
    package A;
    public class ClassB{
         public static ClassA CA;  //Problem Here
    }As the sample above, i cannot declare public static ClassA CA in ClassB. Any way I can solve this? Can I import ClassA into package A? Thanks.
    Edited by: ocboon8 on Apr 6, 2008 6:50 AM

    A class that is in a package cannot access a class that is not in a package.
    db

  • Am using short keyboard.  Don't know how to create plus sign which is not on the keyboard. Advice would be much appreciated.

    Am using short keyboard.  Don't know how to create plus sign which is not on the keyboard. There is no number pad. Advice would be much appreciated.

    nicholasmitaka-shi wrote:
    This is a Japanese kana input keyboard, A1242, whioch looks quite as usual except that a few functions have no space on the board and have been ommitted. 
    Is the plus sign really not available on your keyboard at the place indicated on this graphic (to the right of the L key)? You might need to use shift or alt/option or shift+alt/option.
    http://en.wikipedia.org/wiki/File:KB_Japanese.svg

  • How to remove the tasks which are not manually recoverable?

    How to remove the tasks which are not manually recoverable?
    I tried performing manual recovery for the BPEL processes but there are few tasks which cant be manually recoverable..
    Could you please tell me how to remove those tasks and also tell me which information in the console is the task_id in the database?

    This article explains how to cleanup bpel process instances, you can find task instance id by searching for data in payload using api.
    Managing a BPEL Production Environment
    http://www.oracle.com/technology/pub/articles/bpel_cookbook/blanvalet.html
    Cheers,
    Rad

  • After "upgrade" to new firefox, bookmarks didn't transfer. Help tells how to import from another browser but not old firefox. Also my anti virus (latest update) apparently not compatible with 4.0 Can I restore my old version

    Question
    After "upgrading" to new firefox none of my bookmarks are in new bookmarks help topics tell me how to import from another browser but not from previous version of firefox. Another problem is my anti virus ( most up to date) is apparently not compatible with 4.0 liked the old firefox would never have "upgraded" had I known my anti virus wouldn't work. Can I get old version back

    Check with Kaspersky as to what versions of Firefox their programs are compatible with. It is up to Kaspersky to keep their stuff up to date as Mozilla releases new versions of Firefox. And if they are unwilling or incapable of doing it, they should inform their customers of such and maybe refund their customers instead of stringing them along.
    http://forum.kaspersky.com/

  • How to import custom classes from model to view controller in adf?

    hi...
    i have some custom classes in model layer in adf.
    i want to use them in view controller but i cannot import them.
    how is this possible?
    my jdev version is 11.1.1.5

    You normally don't have to do anything special. The view controller project has a dependency to the model project. So simply typing the class name should show you hte option to generate the need import statement for the class.
    However, not all classes which reside in the model project should be imported into the view Controller as it might break the MVC pattern.
    Timo

  • How to import the classes?

    Hai to all,
    May I know how to import the packages in j2me that are not in the midpapi classes.
    If I had some new package and I want to import that to my application
    For example .
    The javax.mail package is with me but I don't know how can I import it to my application.How to set a classpath to it.
    (I set a classpath so that the j2me is not accepting the package but j2se is accepting is ther a special way to set a classpath to those package and where to keep those packages i.e in which folder ...)
    Awaiting for the answers ..
    Thanks to you

    for sms check i.e. http://www.simplewire.com/. i know that there were some more companies but can't recall their names now :(
    for encryption: i'd use midp 2.0 and rms, let user write their message, store it encrypted on rms and then send using some sms api. but that's just me ;)
    hth

  • How to import a class from a package at the same level

    Hello friends,
    i have a class as Plaf.java
    as
    package org.vaibhav.swing.plaf;
    import java.awt.*;
    import javax.swing.*;
    public class Plaf {
    other code
    }as you see, this is in org.vaibhav.swing.plaf package.
    I have one more class as
    package org.vaibhav.swing.frames;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class StartFrame extends JFrame implements ActionListener {
    other code
    }and this class is in package org.vaibhav.swing.frames
    Please hlp me how to use the class Plaf in StartFrame.java. Rather what import statement should i use in StartFrame.java.
    please help.
    thank you
    Message was edited by:
    vaibhavpingle

    but it then gives me this error
    StartFrame.java:11: package org.vaibhav.swing.plaf
    does not exist
    import org.vaibhav.swing.plaf.*;
    Have you first compiled Plaf.java and saved it in this directory strucuture
    /org/vaibhav/swing/plaf/
    And also have you set your classpath to the parent directory of org folder.
    Message was edited by:
    qUesT_foR_knOwLeDge

  • How to import a .class in eclipse?

    I have a .class file w/ out the source, and im tiring to import that into my project.
    So I go to import->File System and check the .class file. It shows up in my project but when I try to instantiate it I get a "can not be instantiated to a type" error.
    any thoughts?
    this is happening to a lot of people in my course.
    thanks!

    Hi,
    i tried that what you sad, but my eclipse can't import that class.
    So: I have eclipse 3.1, and i would like to import a class (without source). I develop at the moment a J2ME project with eclipse.
    The class what i want to import is in a package, so i must to import like this: import net.jscience.math.kvm.MathFP;
    Can you tell me how in the hell can i this class to import?
    (I tried about 6 hours long, and i got some result, but not the really perfect.)
    When i make this subdirectory structure (what is in the import line) into my project, then in eclipse work the auto completing, 'till the class name. :-/. But the class is there. Egal i add an external class folder, i got always the same result.
    Please help me, because my brain at the moment wants to explode.
    Thanks a lot.

Maybe you are looking for

  • How can I open an AEP project and make all media OFFLINE?

    Hi There, I am working with an AEP file that is on the network that has pretty heavy media files linked to the project. Every time I open the file over the network, AE takes FOREVER to open it. I remember somebody showed me a way to open up a file an

  • Hot to show documents for values of infoobjects (master data)?

    helly everybody, i try again to explain what i wanna do. maybe anybody can help me? thx anyway for all other replies before! by SEM-BPS planning functions our users can create documents for values saved in cube and infoobjects masta data. in another

  • Debit/Credit Indicator in VA05 Transaction

    Hi, We have a requirement where in a new program designed in lines of VA05 for open sales orders & customer needs to differentiate Debits & Credits separetely for all the open sales orders. When checked in VA05 there is a field named as Debit/Credit

  • Rollup process is getting failed in PC

    Hi, The Rollup job gets failed daily in PC with following error message " Error when structuring the index of aggregate 100929 for InfoCube /BIC/FICPROB "and once i repeat the job it will get success. I need to know the reason why it get fail, if any

  • MBP mid '09 not reading internal hard drive

    I have a Macbook Pro Mid 2009 recently updated to Mountain Lion. 2.53 Ghz RAM 8 GB 350 GB HHD Shortly after (updating OS) maybe a day or so, my MBP froze. Applications would not open and programs were frozen. I was unable to force quit opened applica