How can i call a method from the a subdirectory using packages

This is my directory structure:
java
--p1
--One.java
--p2
--Two.java
package java.p1;
import p2.Two;
public class One
     public static void main(String args[])
          Two obj = new Two();
          obj.p();
package java.p2;
public class Two
     public void p()
          System.out.println("p method");
ERRORS !!
C:\Documents and Settings\ashutosh\Desktop\java\p1\One.java:3: package p2 does not exist
import p2.Two;
          ^
C:\Documents and Settings\ashutosh\Desktop\java\p1\One.java:9: cannot find symbol
symbol  : class Two
location: class java.p1.One
          Two obj = new Two();
                ^
C:\Documents and Settings\ashutosh\Desktop\java\p1\One.java:9: cannot find symbol
symbol  : class Two
location: class java.p1.One
          Two obj = new Two();
                              ^Help me out. Thanks.

jinchuriki123 wrote:
This is my directory structure:
java
--p1
--One.java
--p2
--Two.java
package java.p1;
import p2.Two;
public class One
     public static void main(String args[])
          Two obj = new Two();
          obj.p();
package java.p2;
public class Two
     public void p()
          System.out.println("p method");
ERRORS !!
C:\Documents and Settings\ashutosh\Desktop\java\p1\One.java:3: package p2 does not exist
import p2.Two;
^
C:\Documents and Settings\ashutosh\Desktop\java\p1\One.java:9: cannot find symbol
symbol  : class Two
location: class java.p1.One
          Two obj = new Two();
^
C:\Documents and Settings\ashutosh\Desktop\java\p1\One.java:9: cannot find symbol
symbol  : class Two
location: class java.p1.One
          Two obj = new Two();
^Help me out. Thanks.You don't have a class p2.Two, You do have a class java.p2.Two. Package paths aren't relative.
Also, it's recommended not to use package names containing "java" or "javax" (or is it illegal to do so?). Change your package & folder names.
db

Similar Messages

  • How can i call a procedure from the app

    hi
    i have an establish connection to a database (MS SQL SERVER 2000) , i can get data from the tabels by sql statments.
    i have stored procedure in the database , how dan i run procedure with parameters from the app.
    lets say i have one procedure that takes one parameter "city_name"
    procedure delete_city ( @city_name char(100) )
    how can i run it
    thanks ahead
    johny

    Hi,
    Assuming con is the connection object:
    Assuming city_name is the name of the city to be passed to the stored proceduer
    Step 1: Create a callable statement object e.g. CallableStatement cs = con.preparecall("{delete_city(?)}");
    Step 2: Set the IN paramter of the stored procedure e.g. cs.setString(1, city_name);
    Step 3: Execute the callable statement e.g. ResultSet rs = cStat.executeQuery(); //assuming only one resultset is returned by your stored procedure
    Step 4: Process the resultset as you do for getting data from your other sql statements.
    This is a very basic way to execute a stored procedure. The complexity lies in executing stored procedures :
    1) which return a value
    2) which will result in multiple result sets
    3) having IN, OUT and INOUT parameters
    4) a combination of any or all of the above
    I would suggest you look up the JDBC API to get more details.
    Regards,
    bazooka

  • HT201304 How can I purchase free apps from the appstore without using a credit card?

    I really need you're help !

    You'll have to have a creidy card/ debit card on file still. The card will not be charged unless you're make a puchace. Free apps don't count as a purchase. They will show up as a 0.00 charge. Apple will not charge your card unless it's a purchace that actually costs money

  • 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

  • How can I get an invoice from the Apple store note that the original invoice may be burned with the house though Bamkmkm Send to Olga miles is my new (email address removed)and Thanks

    how can i get an invocce from the Apple store UK ?
    Message was edited by: Host

    Find the Apple Customer Support phone number for whichever country you're in and call them for assistance.

  • How can I call a function from a procedure

    I have a function named: f_calc_value which return the variable v_result. This function is part of a package.
    How can I call this function from a new procedure I am creating?
    Thanks

    or refer this theread....calling function from procedure

  • How can I call a RFC from dynpage ?

    Hi!
    I would like to know how can I call a RFC from a Portal aplication, dynpage or jspdynpage. there include some libraries ?
    any idea?
    thanks

    for deploying SAP Jra :
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ad09cd07-0a01-0010-93a9-933e247d3ba4#search=%22how%20to%20use%20jca%20sapjra%20site%3Asap.com%22
    For lookup of SAP Jra use:
    com.sapportals.connector.connection.IConnectionFactory connectionFactory =(IConnectionFactory) initctx.lookup( "deployedAdapters/SAPFactory/shareable/SAPFactory");
    Using SAP Jra
    http://help.sap.com/saphelp_nw04s/helpdata/en/47/13044258bdd417e10000000a1550b0/content.htm
    The important jars required are:
    connector.jar
    Genericconnector.jar
    prtjndisupport.jar
    Thanks

  • How can i call a zreport from my bsp page.

    Hi friends,
    How can i call a zreport from my bsp page.
    Moosa

    Hi Friend,
    These are the codings  to be wirtten in BSP for transferring values to the REPORT
    DATA:wf_date TYPE ztable-ID.
          data:seltab type standard table of rsparams,
           wa_seltab like line of seltab,
         event TYPE REF TO if_htmlb_data.
    DATA:p_value TYPE REF TO CL_HTMLB_INPUTFIELD.
    event = cl_htmlb_manager=>get_event( runtime->server->request ).
    p_requ ?= CL_HTMLB_MANAGER=>GET_DATA(
                                            request  = runtime->server->request
                                            name     = 'inputField'
                                            id       = 'i1'
    if p_requ is not initial.
      wf_date = p_requ->value.
    endif.
    clear wa_seltab.
    if wf_date is not initial.
      wa_seltab-selname = 'P_REQU'.
      wa_seltab-kind = 'P'.
      wa_seltab-option = 'EQ'.
      wa_seltab-low = wf_date.
      append wa_seltab to seltab.
    endif.
    submit *ZSAMPLEAP1* with selection-table seltab AND RETURN  .(ZSAMPLEAP1 refers to the report name and AND RETURN for coming back to the BSP page after the completion of its operation in Report )
    IMPORT int_name TO int_name FROM MEMORY ID '*zid*'.(For importing the obtained value from Report)
    In Report
    REPORT  ZSAMPLEAP1.
    SELECT-OPTIONS: p_requ FOR ztable-id  NO INTERVALS.
    SELECT SINGLE name from ztable into int_name WHERE id = p_requ-low.
    WRITE:int_name.
        EXPORT int_name TO MEMORY  ID 'zsharmila'.
    With Regards,
    SHARMILA BRINDHA.M

  • How can we call a report from a form.

    how can we call a report from an existing form.

    Have you searched the Forms help system? It shows you how to use RUN_REPORT_OBJECT

  • How Can I call Crystal report from R3?

    Hi experts,
      How Can I call Crystal report from R3?

    Hi Bill,
    Can you please be specific and could you please provide the steps
    Thank you

  • How can i call ajax and extract the data?

    Hi all,
    I don't know briefly about ajax..i want to learn ajax, so my question is how can i call ajax and extract the data. for ex, i have JSON file
        "mobile": [
                "Name": "Micromax",
                "Model": A310
                "Name": "samsung",
                "Model": grand 2
    for above example how can i call ajax..please anyone explain with small example because it'll help me a lot.
    Thanks & Regards,
    Palsaran

    Hi Palsaran,
    As i understood, your requirement is to POST data from UI to backend.
    The above code you given is not correct if you want to use model based implementation.
    In UI5 you don't need to do an explicit Ajax call, for which we can use Models like OData, JSON etc.
    For your JSON example, you can use like,
    var oModel = new sap.ui.model.json.JSONModel();
    var oData = "YOUR JSON DATA";
    oModel.setData(oData)
    oModel.loadData(yourURL/Entityset,"POST");
    For ref, you can use the below link
    JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - sap.ui.model.json.JSONModel
    Thanks
    Naveenraj

  • Hi! how can I delete a book from the iCloud? I bought the wrong book ... is for adults and I have kids...so

    Hi! how can I delete a book from the iCloud? I bought the wrong book ... is for adults and I have kids...so

    The most comprehensive delete method I know about is to delete the book from iTunes on the computer you sync your iPad with.  You'll be asked if you're sure, and it will be deleted from your iPad and any other i-Device you sync to.
    I think that's the best you can do.

  • How can I get all photos from the camera roll onto the photo stream so they will share between iphone and ipad?

    How can I get all photos from the camera roll, and all new pictures taken, to get on the photostream so they can share between iphone and ipad?

    When turning PhotoStream on with photos available in the Camera Roll, only photos captured by the iPhone or saved on the iPhone are placed in the PhotoStream.
    For all photos that were in the Camera Roll prior to turning PhotoStream on, import the photos with your computer and add the photos to your PhotoStream on your computer.

  • How can I make different catalogs from the same image

    How can I make different catalogs from the same image where that image has been changed in some way between the catalogs. For instance if I wanted to have a catalogs for cropped images and have 3 catalogs one for 4x6 , 5x7 and 8x10 cropping. When I tried this , if I changed a file in one catalog that same image in the other would change also.

    Do not confuse the creation of the crops and the display in collections per crop ratio.
    Of course one virtual copy (VC) per crop ratio is needed. If the same image should be cropped in all 3 mentioned ratios there would be 3 VCs.
    The OP asked how to have/see a set of same-crop-ratios.
    After having created the virtual copies for whatever crop ratio he wants, the way to display this result in the fashion asked for is via smart collections, provided they can be found. Without a plugin the naming of the VC with the crop ratio applied is a straight way to achieve that.
    IF the wish is to get new crops automatically added. (See my answers 2+3)
    IF the wish is to creat static collections per crop ratio for a certain set of images, I'd go as follows:
    1. Select all images you want to have cropped in that way,.
    2. With this selection click on the + to add another collection and fill the dialog box like this:
    Then navigate into this newly created selection and perform the 4x6 crop - according to taste individually or by synchronizing the first crop.
    Cornelia

  • HT5622 We have two iphones with the same Apple ID. Since I installed iOS this morning I have started receiving all my sons texts and when I send him a text it is delivered to both of us. How can I remove my phone from the joint Apple ID and remove myself

    My son and I both have iphones with the same Apple ID. Since I installed iOS this morning I have started receiving all my sons texts and when I send him a text it is delivered to both of us. How can I remove my phone from the joint Apple ID and remove myself from finding out what he is up to during Freshers week!

    You have to use a different Apple ID for your son.
    Read this note:
    iOS 5 & iCloud Tips: Sharing an Apple ID With Your Family
    still valid for ios 7

Maybe you are looking for

  • Getting overprint preview preference in Adobe Acrobat 9

    Hello, yesterday I installed the Adobe Acrobat 9 Trial and I tried my plugin. Does anyone know how to get the overprint preview setting? In older version of Adobe Acrobat I'm using following code: AVAppGetPrefBool(DSAVSettings[prefNumber].m_section,

  • Https access to Sap Content Server 620 with R/3 46C

    We are trying to access the Sap Content Server 620 via Https. We do not want to administer it via HTTPS, (as we know CSADMIN doesn't support Https in rel. 46C as for note 712332). We want to do in way that the users when do check-in/out of originals

  • PSE 13 won't open.

    I've installed the PSE13 upgrade (I currently have PSE9) but it won't open. When I sign in all I get is the revolving squares. It seems to be in a loop or stalled. I've downloaded twice and rebooted twice but still no luck.

  • How to 'overrule' password policy for one user ?

    hi, i am system administrator on our ECC 6.0. we have 4 clients, test and production. so i have 8 users, not everyone has the same password (for some reasons). when i want to change the password i get the message that the passwortd cannot be on of th

  • Currency Variable?

    Hi, Our onsite folks have made changes to currency fields.In the properties of the currency field ie Total value. They have made settings in currency translation , <b>currency coversion key as currecny rate(today's Date) and target currency</b> as  f