Can we initiate a class without extending or importing that class or packag

Can we invoke a class
class dog
public static void main(String args[])
Animal a = new Aniamal();
like this without extending or importing the package belongs to animal.

Can we invoke a class
class dog
public static void main(String args[])
Animal a = new Aniamal();
like this without extending or importing the package
belongs to animal.give it the package location
class dog
  public static void main(String args[])
    org.mypackage.Animal a = new org.mypackage.Animal();
}

Similar Messages

  • How do you call a method from  another class without extending as a parent?

    How do you call a method from another class without extending it as a parent? Is this possible?

    Why don't you just create an instance of the class?
    Car c = new Car();
    c.drive("fast");The drive method is in the car class, but as long as the method is public, you can use it anywhere.
    Is that what you were asking or am I totally misunderstanding your question?
    Jen

  • ?Is it possible to create a javafx class without extending Application class ? If yes, how

    Is it possible to create a javafx class without extending Application class ? If yes, how ?

      There is no  such thing as a javafx  class.  It is a regular  java class.  The Aapplication class is  the entry
    point  for JavaFX application.  You have to extend the Application class to create Javafx  application .

  • In disk utility, it shows that my external hard drive is somehow unmounted and I can't access it in finder or repair it in Disk Utility. How can I get this working without losing my important data?

    In disk utility, it shows that my external hard drive is somehow unmounted and I can't access it in finder or repair it in Disk Utility. How can I get this working without losing my important data?
    Thank you!

    When you erased the disk did you select Mac OS Extended Journaled as the format option?

  • I want to remove my credit card from my daughter's itunes account but i can't delete the information without getting a notification that i must have the fields filled out

    I want to remove my credit card from my daughter's itunes account but i can't delete the information without getting a notification that i must have the fields filled out. When she first got the ipod touch, we did not need to supply credit card information for her to set up her account. Only now that I entered it for one purchase, I can't remove it. Now my daughter has purchased over $300 in downloads the last two weeks.

    You definitely can.
    To remove your payment information open iTunes and go into your account. An easy way to access your account is from quick links on the store home page. After you login there will be a payment type listed with an edit button next to it. Click edit then select none under card type (next to visa, mastercard, etc).
    Afterwards at the bottom of the page select done, then your card will no longer be on file. It will prompt you for a card next time you try to download something that isn't free.

  • What is the difference between acquiring lock on a CLASS and OBJECT (instance) of that class

    What is the difference between acquiring lock on a CLASS and OBJECT (instance) of that class

    What is the difference between acquiring lock on a CLASS and OBJECT (instance) of that class
    The Java Tutotials has several trails that discuss both implicit and explicit locking, how they work and has code examples.
    The Concurrency trail has the links to the other sections you need to review
    http://docs.oracle.com/javase/tutorial/essential/concurrency/index.html
    The Synchronized Methods and Intrinsic Locks and Synchronization trails discusse Synchronized Methods and Statements
    http://docs.oracle.com/javase/tutorial/essential/concurrency/syncmeth.html
    And the Lock Objects trail begins the coverage of explicit locking techniques.
    http://docs.oracle.com/javase/tutorial/essential/concurrency/newlocks.html

  • Link between Class and characteristics created for that class

    Hi All,
    Is there any table that I can look at to find a link between class and the characteristics created for that class. For all the list of characteristics created I am refereing to CABN table but my requirement is to find the logic to see all the characteristics created for a class. Can anyone suggest me the right table to look at?
    Regards,
    Shane

    Hi,
    I would like to thank you for your quick response. So based on your thoughts, here is the process i followed to find the characteristics for a existing class,  took the Internal class number and used the KSML table to find all the Characteristics created for that class.
    To find the list of values assigned to that characteristics, used the AUSP table for that characteristics internal number.
    Thank you again for your inputs
    Shane.

  • Can airport express be used to extend a network that does not use an apple airport as the primary base station.

    I have a verizon fios cable modem that incorporates a wireless base station using 802.11n and wep 40 bit security.  I decided that I could improve poor reception by using two airport expresses as range extenders.  I cannot seem to configure them for this function.  When I do a manual setup and choose extend a network, I get a message that says the network cannot be extended.  I have been able to join the network, and I think they would work as clients, but I'm trying to use them in as additonal base stations to extend my network.
    The primary base station, and the two airport express units are all within range of each other.
    Now that I have the two units (purchased on sale from Apple this past week), the directions in the manual only include instructions for using them as network extenders with a primary basestation that is Apple?  Is this the case?

    Unfortunately, most non-AirPort routers are not compatible with Apple's implementation of Wireless Distribution System (WDS)...so it very unlikely that your non-AirPort router can be extended wirelessly with the AirPort Express Base Station (AX).
    Your only option would be to connect the AX to the Verizon-provided gateway by Ethernet or use Powerline adapters to create a pseudo Ethernet connection between them. A wireless-only connection will not work.

  • Can I get iPhone 5 without plan in USA

    Can I get iPhone 5 without plan

    No. Not that has been announced yet.  When the 4S first came out, there was a delay of several months before it was possible to purchase one unlocked in the US. Most likely due to supply constraints.

  • 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.

  • 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.

  • Extending a component that uses mx:script

    I have a Flex project whose main mxml file includes an mx:script block, which points to an external file. Although a good deal of the functionality of the application is abstracted into classes, a fair bit of the implementation such as UI element animation / interaction is inside the file pointed to by mx:script.
    I now have to make an extension to the application, but don't want to copy-paste the script file. However as it is not a class, I can't just extend it, and I can't include it into another file and override its methods either. I could wrap the whole thing inside a class, but then I'll be forced to refer to stage components using this["componentName"] instead of just this.componentName, I also don't get code completion using this, and there are hundreds of places in the file I'd need to correct.
    Has anyone run into the issue of trying to extend an mxml component like this? If so, how did you do it?

    Ok so I read up on MXML documentation, and how that translates to a compiled .swf file, and found that functions and variables declared in the mx:script block are added to the application's class upon compile. With this, I reasoned that if I declared my old application as a custom class, and then inherited from that class with the new application, the new app would inherit everything from the old one... Didn't work. However, if instead of declaring a custom class for the old application, I instead declare a custom class for my new app that extends the old apps application NAME, stuff compiles. I'm getting some null pointer errors though, so not sure if something went tits up somewhere, will investigate.

  • Eclipse plugin error (import java class)

    Hello, I am actually developing a complex interface program in JavaFx, the main component is a Swing component with a universe 3D inside (a map of a buildign). So in some javafx classes I have to import java classes and I obtain an import error. I have in the same package a java class and a javafx class with the same import and I only have the error in the javafx one.
    Does somebody have the same error? or know how can I fix it?
    Thanks and Regards

    Thanks for your suggestion, in fact I'm actually developing in Netbeans. My application is really complex I have a java3D universe in a swing component and the javaFx nodes are drawn on it. When I load some nodes and move them over the 3D I obtain a JVM error, I've read that it could be solved in some cases compiling the project in eclipse so I'm trying to do it.
    I tried to solve the JVM error hardly, at first it was thrown every time I load a new module in my scene an moved it, I improve the performance of my application and I've decreased the error a lot. In fact, the error only appear if I load the 3D universe and I'm sure that is because of the rendering. I've tried all I can imagine so now I'm trying that kind of stupid thing.
    Thanks and Regards

  • How to import java Classes in report Builder

    Hi, I want to import classes from a jar file into Report Builder (10 g). I'm not able to find my JAR in -- Program --> Import Java Classes option.
    I have set the classpath pointing to my JAR.

    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 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

Maybe you are looking for

  • Slow start up and Shut Down since upgrading to Mountain Lion - Etrecheck Result query

    Hello, I have recently upgraded my operating system from Snow Leopard to the latest Mountain Lion from the app store. My Macbook Pro (early 2010) is now experiencing slow start up times (more than 1 minute) and slow shut down (more than 45 seconds).

  • LOV not shown in ViewLink

    I have two view objects based on entitys: EOUsuarioWeb-->users EOGesdusrrol.--> user with rol I create a viewLink matching "EOUsuarioWeb.Usrcodigo" with "EOgesdusrrol.Gescodusr" with one to one relationship. When I run the application module, clic on

  • Printing problem with WindowsXP

    I've written a Java application using SDK v1.4.0 and this class works with all printers and Windows versions (95, 98, ME) on the several PCs I've tested it on except the machine running WindowsXP. Using WindowsXP, the page prints out the border aroun

  • IPhoto 09 June update destroys RAW support on Nikon D80 images

    Anyone else see this? You can go to edit a D80 image after the update and it just turns it a dark shade of green as soon as you try to do anything else to it. MacBook Pro (new) user here. It didn't do this before the patch. I called tech support they

  • Am not getting Adapters at Integration Directory.

    Hi Experts, I have installed Xi have done all post installatoin steps, when am doing a scenario , when creating a Communication Channel in Integration Directory it is not showing adapters list , it is Showing as *No Objects are there*. Am fully confu