Please Help!!! Problems access other classes methods

I am having a problem accessing another classes methods varibles. I have tried a number of ways but with no success. Here is my problem:
I have the main(), from there it's calls the class GetVar(), GetVar stores info in Class HousingForVar(), and finially, I have a class TryinToTalkToHousing() that I use to access HousingForVar()'s methods. I know I can use the keyword new but if I do that then it erases over the data I put in. Please can anyone help, this has been driving me nutz all day. Thank you in advance.
Roman03
***EACH CLASS IS A DIFFERENT FILE****
public class TestMain
     public static void main( String args[] )
          GetVar getVarible = new GetVar();
          getVarible.heroF();
import java.util.Scanner;
public class GetVar
     public void heroF()
          String someEntered;
          Scanner input = new Scanner( System.in);
          System.out.println("Enter a string: ");
          someEntered = input.next();
          HousingForVar houseForData = new HousingForVar(someEntered);
          System.out.printf("Retieved from Class GetVar, you entered: %s\n", houseForData.getCollectVar() );
import java.util.Scanner;
public class HousingForVar
     private String getData;
     public HousingForVar(String enterInfo)
          getData = enterInfo;
     public void setGetVar(String enterInfo)
          getData = enterInfo;
     public String getCollectVar()
          return getData;
import java.util.Scanner;
public class TryinToTalkToHousing
     public void someMeth()
          String getInfoFromHousing;          
          System.out.printf("Started out at TryinToTalkToHousing Class\n Retieved from Class GetVar from %s\n",
          houseForData.getCollectVar() );
\* I know this doesn't work, but if I make a new object of the class HousingForVar it's going to write over my input, so what do I do? I am still learning, Please help*\

I don't use 1.5, so you'll have to convert it back, but see if you can follow the flow of this
import java.io.*;
class TestMain
  GetVar getVarible;
  public TestMain()
    getVarible = new GetVar();
    getVarible.heroF();
    System.out.println("******");
    new TryinToTalkToHousing(this).someMeth();
  public static void main(String[] args){new TestMain();}
class GetVar
  HousingForVar houseForData;
  public void heroF()
    try
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      System.out.print("Enter a string: ");
      String someEntered = br.readLine();
      houseForData = new HousingForVar(someEntered);
      System.out.println("Retieved from Class GetVar, you entered: "+houseForData.getCollectVar()+"\n");
    catch(Exception e){e.printStackTrace();}
class HousingForVar
  private String getData;
  public HousingForVar(String enterInfo)
    getData = enterInfo;
  public void setGetVar(String enterInfo)
    getData = enterInfo;
  public String getCollectVar()
    return getData;
class TryinToTalkToHousing
  TestMain parent;
  public TryinToTalkToHousing(TestMain t){parent = t;}
  public void someMeth()
    System.out.println("Started out at TryinToTalkToHousing Class\n"+
    "Retieved from Class GetVar, you entered: "+parent.getVarible.houseForData.getCollectVar()+"\n");
}

Similar Messages

  • Problem  Accessing Protocol Classes in INBOUND PROXY

    Hi guys.
    Im having problems accessing Protocol Classes in a inbound proxy.
    I have this code that is copied from:
    http://help.sap.com/saphelp_nw04/helpdata/en/a7/3b2a2d45a34a23b75e3b18745c63bc/frameset.htm
    DATA:  lo_server_context   TYPE REF TO if_ws_server_context,
                 lo_payload_protocol TYPE REF TO if_wsprotocol_payload.
    lo_server_context   = cl_proxy_access=>get_server_context( ).
    lo_payload_protocol =
         lo_server_context->get_protocol( if_wsprotocol=>payload ).
    But Im getting this error:
    The result type of the function method cannot be converted into the type lo_payload_protocol
    If I try to get the attachment protocol with this code:
    DATA: lo_server_context TYPE REF TO if_ws_server_context,
    lo_attachment_prtcl TYPE REF TO IF_WSPROTOCOL_ATTACHMENTS.
    lo_server_context = cl_proxy_access=>get_server_context( ).
    lo_attachment_prtcl = lo_server_context->get_protocol( if_wsprotocol=>ATTACHMENTS ).
    Im getting the same error.
    What am I doing wrong? It' s code copied fror SAP Library!!!
    Thanks a lot.

    hi,
    you are choosing wrong type for lo_payload_protocol.
    you must change like this
    lo_payload_protocol TYPE REF TO IF_WSPROTOCOL.
    regards,
    orhan

  • Getting problem with DOMImplementation classes method getFeature() method

    hi
    getting problem with DOMImplementation classes method getFeature() method
    Error is cannot find symbol getFeature()
    code snippet is like...
    private void saveXml(Document document, String path) throws IOException {
    DOMImplementation implementation = document.getImplementation();
    DOMImplementationLS implementationLS = (DOMImplementationLS) (implementation.getFeature("LS", "3.0"));
    LSSerializer serializer = implementationLS.createLSSerializer();
    LSOutput output = implementationLS.createLSOutput();
    FileOutputStream stream = new FileOutputStream(path);
    output.setByteStream(stream);
    serializer.write(document, output);
    stream.close();
    problem with getFeature() method

    You are probably using an implementation of DOM which does not implement DOM level-3.

  • Premiere Pro CS5: please help problem with importing a file error output "there was an error decompressing audio or video"

    please help problem with importing a file error output "there was an error decompressing audio or video"

    this is related to what adobe program/version?

  • Please help me what other way i can tune this select query..

    Hello Guru,
    I have a select query which retrieve data from 10 tables and around 4 tables having 2-4 Lac record and rest are having 80,000 - 1 Lac record.
    It is taking around 7-8 seconds to fetch 55000 record.
    I was strictly told by the client that i should not use HINTS in my query. My query is below. Please help me what other way i can tune this select query..
    select
    CT.CUST_ID
    ,CT.ROMANISED_SURNAME
    ,CT.SURNAME
    ,CT.ROMANISED_GIVEN_NAME
    ,CT.GIVEN_NAME
    ,CT.ROMANISED_MIDDLE_NAME
    ,CT.MIDDLE_NAME
    ,CT.ROMANISED_NAME_SUFFIX
    ,CT.NAME_SUFFIX
    ,CT.ROMANISED_TITLE
    ,CT.TITLE
    ,CT.ROMANISED_NAME_INITIALS
    ,CT.NAME_INITIALS
    ,CT.NAME_TEXT
    ,CT.CUST_JRNY_ID
    ,RK.REMARK_TYPE
    ,RK.REMARK_ID+CT.CUST_ID as REMARK_ID
    ,RK.REMARK_STATUS
    ,RK.REMARK_TEXT
    ,RK.HOST_ONLY_IND
    ,RK.SUPERVISORY_IND
    ,RK.CUST_COMM_IND
    ,RK.REMARK_SEQ
    ,RK.REMARK_CODE
    ,RK.DEFAULT_CUST_REL_IND
    ,RK.DEFAULT_FLIGHT_SEG_REL_IND
    ,RK.IATA_CODE
    ,RK.ICAO_CODE
    ,CJ.RECORD_LOCATOR "SITA_RECORD_LOCATOR"
    ,Cjv.Record_Locator "ORIGINATOR_RECORD_LOCATOR"
    ,FS.TRAVELLING_GROUP_CODE
    ,CG.GROUP_NAME
    FROM FLIGHT_LEG FL
    ,CUST_FLIGHT_LEG CFL
    ,CUST CT
    ,CUST_REMARK CTR
    ,REMARK RK
    ,FLIGHT_SEG_FLIGHT_LEG FSFL
    ,FLIGHT_SEG FS
    ,CUST_JRNY CJ
    ,CUST_JRNY_VERSION CJV
    ,CUST_GROUP CG
    WHERE FL.OPR_FLIGHT_NUMBER = 1--I_OPR_FLIGHT_NUMBER
    and FL.HISTORY_VERSION_NUMBER = 0
    and FL.DEPARTURE_STATION_CODE = 'DEL'--I_DEPARTURE_STATION_CODE
    and FL.DEPARTURE_DATETIME = TO_DATE('10-DEC-2012 18.45.00', 'DD-MON-YYYY HH24.MI.SS')
    and FL.OPR_SERVICE_PROVIDER_CODE= 'AI'--i_opr_service_provider_code
    and FL.OPR_FLIGHT_SUFFIX = 'A'--NVL(I_OPR_FLIGHT_SUFFIX, FL.OPR_FLIGHT_SUFFIX)
    AND FL.FLIGHT_LEG_ID = CFL.FLIGHT_LEG_ID
    AND CFL.CUST_ID = CT.CUST_ID
    AND FL.FLIGHT_LEG_ID=FSFL.FLIGHT_LEG_ID
    AND FSFL.FLIGHT_SEG_ID=FS.FLIGHT_SEG_ID
    AND CT.CUST_ID = CTR.CUST_ID(+)
    AND CTR.REMARK_ID = RK.REMARK_ID(+)
    AND FL.CUST_JRNY_ID = CJ.CUST_JRNY_ID
    and CJ.CUST_JRNY_ID = CJV.CUST_JRNY_ID
    AND CG.CUST_JRNY_ID(+) = CT.CUST_JRNY_ID
    AND CFL.HISTORY_VERSION_NUMBER = 0
    AND CT.HISTORY_VERSION_NUMBER = 0
    AND NVL(CTR.HISTORY_VERSION_NUMBER,0) = 0
    AND NVL(RK.HISTORY_VERSION_NUMBER,0) = 0
    AND FS.HISTORY_VERSION_NUMBER = 0
    AND FSFL.HISTORY_VERSION_NUMBER = 0
    -- AND CJ.HISTORY_VERSION_NUMBER = 0
    and CJV.VERSION_NUMBER = 0 --- Need to check
    AND NVL(CG.HISTORY_VERSION_NUMBER,0) = 0
    order by CT.CUST_JRNY_ID,CT.CUST_ID;
    The Tables having record:
    select COUNT(*) from FLIGHT_LEG -----241756
    select COUNT(*) from CUST_FLIGHT_LEG---632585
    select COUNT(*) from CUST---240015
    select COUNT(*) from CUST_REMARK---73724
    select COUNT(*) from REMARK---73654
    select COUNT(*) from FLIGHT_SEG_FLIGHT_LEG---241789
    select COUNT(*) from FLIGHT_SEG----260004
    select COUNT(*) from CUST_JRNY----74288
    select COUNT(*) from CUST_JRNY_VERSION----74477
    select COUNT(*) from CUST_GROUP----55819
    Thanks,
    HP..

    Plan hash value: 3771714931
    | Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time | Pstart| Pstop |
    | 0 | SELECT STATEMENT | | 10239 | 2949K| | 7515 (1)| 00:01:31 | | |
    | 1 | SORT ORDER BY | | 10239 | 2949K| 3160K| 7515 (1)| 00:01:31 | | |
    |* 2 | HASH JOIN | | 10239 | 2949K| | 6864 (1)| 00:01:23 | | |
    | 3 | PARTITION HASH ALL | | 73687 | 1079K| | 417 (1)| 00:00:06 | 1 | 512 |
    |* 4 | TABLE ACCESS FULL | CUST_JRNY_VERSION | 73687 | 1079K| | 417 (1)| 00:00:06 | 1 | 512 |
    |* 5 | HASH JOIN | | 10239 | 2799K| | 6445 (1)| 00:01:18 | | |
    | 6 | PARTITION HASH ALL | | 73654 | 863K| | 178 (1)| 00:00:03 | 1 | 512 |
    | 7 | TABLE ACCESS FULL | CUST_JRNY | 73654 | 863K| | 178 (1)| 00:00:03 | 1 | 512 |
    |* 8 | FILTER | | | | | | | | |
    |* 9 | HASH JOIN RIGHT OUTER | | 10239 | 2679K| | 6267 (1)| 00:01:16 | | |
    | 10 | PARTITION HASH ALL | | 55315 | 756K| | 137 (1)| 00:00:02 | 1 | 512 |
    | 11 | TABLE ACCESS FULL | CUST_GROUP | 55315 | 756K| | 137 (1)| 00:00:02 | 1 | 512 |
    |* 12 | FILTER | | | | | | | | |
    |* 13 | HASH JOIN OUTER | | 10240 | 2540K| 2056K| 6129 (1)| 00:01:14 | | |
    |* 14 | FILTER | | | | | | | | |
    |* 15 | HASH JOIN RIGHT OUTER | | 10242 | 1930K| | 5531 (1)| 00:01:07 | | |
    | 16 | INDEX FAST FULL SCAN | CUST_REMARK_PK | 73677 | 935K| | 190 (0)| 00:00:03 | | |
    |* 17 | HASH JOIN | | 10257 | 1802K| | 5339 (1)| 00:01:05 | | |
    |* 18 | HASH JOIN | | 10257 | 701K| | 3516 (1)| 00:00:43 | | |
    |* 19 | HASH JOIN | | 3963 | 220K| | 2476 (1)| 00:00:30 | | |
    |* 20 | HASH JOIN | | 3963 | 181K| | 1300 (1)| 00:00:16 | | |
    | 21 | PARTITION HASH ALL | | 3963 | 131K| | 728 (1)| 00:00:09 | 1 | 512 |
    |* 22 | TABLE ACCESS FULL | FLIGHT_LEG | 3963 | 131K| | 728 (1)| 00:00:09 | 1 | 512 |
    |* 23 | INDEX FAST FULL SCAN| FLIGHT_SEG_FLIGHT_LEG_PK | 240K| 3059K| | 571 (1)| 00:00:07 | | |
    | 24 | PARTITION HASH ALL | | 259K| 2531K| | 1175 (1)| 00:00:15 | 1 | 512 |
    |* 25 | TABLE ACCESS FULL | FLIGHT_SEG | 259K| 2531K| | 1175 (1)| 00:00:15 | 1 | 512 |
    | 26 | PARTITION HASH ALL | | 631K| 8011K| | 1037 (1)| 00:00:13 | 1 | 512 |
    |* 27 | TABLE ACCESS FULL | CUST_FLIGHT_LEG | 631K| 8011K| | 1037 (1)| 00:00:13 | 1 | 512 |
    | 28 | PARTITION HASH ALL | | 239K| 25M| | 1822 (1)| 00:00:22 | 1 | 512 |
    |* 29 | TABLE ACCESS FULL | CUST | 239K| 25M| | 1822 (1)| 00:00:22 | 1 | 512 |
    | 30 | PARTITION HASH ALL | | 73623 | 4385K| | 243 (1)| 00:00:03 | 1 | 512 |
    | 31 | TABLE ACCESS FULL | REMARK | 73623 | 4385K| | 243 (1)| 00:00:03 | 1 | 512 |
    Predicate Information (identified by operation id):
    2 - access("CJ"."CUST_JRNY_ID"="CJV"."CUST_JRNY_ID")
    4 - filter("CJV"."VERSION_NUMBER"=0)
    5 - access("FL"."CUST_JRNY_ID"="CJ"."CUST_JRNY_ID")
    8 - filter(NVL("CG"."HISTORY_VERSION_NUMBER",0)=0)
    9 - access("CG"."CUST_JRNY_ID"(+)="CT"."CUST_JRNY_ID")
    12 - filter(NVL("RK"."HISTORY_VERSION_NUMBER",0)=0)
    13 - access("CTR"."REMARK_ID"="RK"."REMARK_ID"(+))
    14 - filter(NVL("CTR"."HISTORY_VERSION_NUMBER",0)=0)
    15 - access("CT"."CUST_ID"="CTR"."CUST_ID"(+))
    17 - access("CFL"."CUST_ID"="CT"."CUST_ID")
    18 - access("FL"."FLIGHT_LEG_ID"="CFL"."FLIGHT_LEG_ID")
    19 - access("FSFL"."FLIGHT_SEG_ID"="FS"."FLIGHT_SEG_ID")
    20 - access("FL"."FLIGHT_LEG_ID"="FSFL"."FLIGHT_LEG_ID")
    22 - filter("FL"."DEPARTURE_STATION_CODE"='DEL' AND "FL"."DEPARTURE_DATETIME"=TO_DATE(' 2012-12-10 18:45:00', 'syyyy-mm-dd
    hh24:mi:ss') AND "FL"."OPR_SERVICE_PROVIDER_CODE"='AI' AND "FL"."OPR_FLIGHT_NUMBER"=1 AND "FL"."OPR_FLIGHT_SUFFIX"='A' AND
    "FL"."HISTORY_VERSION_NUMBER"=0)
    23 - filter("FSFL"."HISTORY_VERSION_NUMBER"=0)
    25 - filter("FS"."HISTORY_VERSION_NUMBER"=0)
    27 - filter("CFL"."HISTORY_VERSION_NUMBER"=0)
    29 - filter("CT"."HISTORY_VERSION_NUMBER"=0)

  • Please help with correcting calling class and method errors

    Hi All,
    I have created a game (like battleship) for 2 tanks. I can't seem to connect the classes and methods to get the values for the last die face rolled; last direction rolled on a 4 headed dice; the x and y position for each tank; the armour value and the firePower (or hit value) to print.
    Each row of these values is supposed to print 50 times using a while loop.
    (N.B. The code is appended below my name.)
    Could anyone please help me? I would be most grateful. Thank you.
    Steve
    import java.util.*;
    class Client
    static Die die;
    static Direction dir;
    static Tank tk1;
    static Tank tk2;
    public static final
    void main( String[] argv)
    die = new Die();
    dir = new Direction();
    tk1 = new Tank();
    tk2 = new Tank();
    int lastFace;
    int setfaceLast;
    int x;
    int y;
    int armourVal;
    int firePower;
    int battleNum=0;
    int battles;
    int moves = 0;
    System.out.println("Tank");
    System.out.println("'\t' Number");
    System.out.println("'\t' Dir");
    System.out.println("'\t' xValue");
    System.out.println("'\t' yValue");
    System.out.println("'\t' Armour");
    System.out.println("Firepower"+'\n');
    int i=0;
    //int getLastFace();
    //int LastDirName();
    while (i <= 50);
    int XPos;
    int YPos;
    Pos p = new Pos();
    p.setXPos(x);
    p.setYPos(y);
    System.out.println ("'\t' Tank 1-");
    //System.out.println ( die.getLastFace());
    //System.out.println( dir.getLastDirName());
    System.out.println(Pos(x));
    System.out.println(Pos(y));
    System.out.println(armourVal);
    System.out.println(firePower+'\n');
    System.out.println ("Tank 2-");
    System.out.println ( lastFace);
    //System.out.println(LastDir);
    System.out.println(x);
    System.out.println(y);
    System.out.println(armourVal);
    System.out.println(firePower+'\n');
    moves++;
    System.out.println(" '\n' + BATTLE");
    class Tank
    public static final int MINGRID;
    public static final int MAXGRID;
    static Die die = new Die();
    static Direction dir = new Direction();
    private static int battleCount;
    private static int moveCount;
    private int x;
    private int y;
    private int armourVal;
    private int firePower;
    public Tank()
    int MINGRID=-10;
    int MAXGRID=10;
    battleCount=0;
    moveCount=0;
    x=0;
    y=0;
    armourVal=10;
    firePower=1;
    public
    int getmove()
    die.roll();
    dir.roll();
    dir.getLastDir();
    die.getLastFace();
    int x;
    int y;
    int Pos;
    switch( dir.getLastDir() )
    case Direction.UP:
    y += die.getLastFace();
    break;
    case Direction.DOWN:
    y -= die.getLastFace();
    break;
    case Direction.RIGHT:
    x += die.getLastFace();
    case Direction.LEFT:
    x-= die.getLastFace();
    break;
    if ( x > MAXGRID )
    x = (2 * MAXGRID) - x;
    else if ( x < MINGRID )
    x = (-2 * MINGRID) - x;
    if ( y > MAXGRID )
    y = (-2 * MAXGRID) - y;
    else if ( y < MINGRID )
    y = (-2 * MINGRID) - y;
    if ( x == -3 && y == -3 )
    firePower++;
    System.out.println("Yipee - more firepower.");
    if ( x == 3 && y == 3)
    this.armourVal += 10;
    System.out.println("Yipee - more armour.");
    return Pos;
    //printDetails();
    public boolean getcontinueBattle(Tank tk2)
    moveCount++;
    if ( x == tk2.x && y == tk2.y)
    battleCount++;
    System.out.println("Battle");
    tk2.armourVal -= firePower;
    armourVal -= tk2.firePower;
    if (tk2.armourVal < 0 )
    int moveCount, battleCount;
    return false;
    if ( armourVal < 0 )
    int moveCount, battleCount;
    return false;
    return true;
    public int getprintDetails()
    int ptDet;
    return ptDet;
    class Direction
    private int lastFaceDir;
    private Random rnd;
    public static final int UP = 1;
    public static final int DOWN = 2;
    public static final int LEFT = 3;
    public static final int RIGHT = 4;
    String direction;
    private
    int getRandomNum()
    int raw = rnd.nextInt();
    raw = Math.abs( raw );
    raw %= 4;
    raw++;
    return raw;
    public
    Direction()
    rnd = new Random();
    roll();
    public
    int roll()
    lastFaceDir = getRandomNum();
    if (lastFaceDir == UP)
    direction = "up";
    else if (lastFaceDir == DOWN)
    direction= "down";
    else if (lastFaceDir == LEFT)
    direction = "left";
    else if (lastFaceDir == RIGHT)
    direction= "right";
    return lastFaceDir;
    public
    int getLastFaceDir()
    return lastFaceDir;
    }// end class
    class Die
    private int lastFace;
    private Random rnd;
    private
    int getRandomNum()
    int raw = rnd.nextInt();
    raw = Math.abs( raw );
    raw %= 6;
    raw++;
    return raw;
    public
    Die()
    rnd = new Random();
    roll();
    public
    int roll()
    lastFace = getRandomNum();
    return lastFace;
    public
    int getLastFace()
    return lastFace;
    }// end class

    I got this sorted!
    I unzipped the JAR and loaded the classes individually - so now the "reference" issue went away. Instead I now have a new problem, but I will post that seperately.

  • Please help to use my class in a JSP

    Hi
    Please could someone help me i've started a new job and need to create like a "Add to shortlist" functionality to their website.
    I have created a class to create a cookie using the offerid specific to that page which is done in the doGet() method.
    Now, the problem is that i don't know how to basically make the cookie be created when the button is pressed.
    I have thought of using <jsp:useBean> and putting my class in there but don't know how to call the doGet() method, if you know what i mean.
    Otherwise i've thought of doing the cookie creating in the JSP but then also i don't know how to make by the click of a button, it creates a cookie with that offerid.
    PLEASE help!? If you need more info pls let me know,
    Btw i am new to this so sorry if this sounds stupid, but thanks in advance for ANY help!

    There is only one thing to do in your case: hit the books and learn how to properly program servlets and JSPs - until you know at least the very basics (clicking a button and "doing something" falls in that category), it will be impossible to guide you to anything productive. I've seen it happen before many times; an answer is given, the answer is not understood and then the demand for "sample code" pops up, after which it all goes downhill fast.
    I always recommend this free online book, because it is quite good:
    [http://pdf.coreservlets.com/|http://pdf.coreservlets.com/]
    If you buckle down, you should be able to get things up and running in a few days. Good luck!

  • Problems accessing my "equals" method

    Hi every body,
    Can any one help me on this? I think is not a big problem but I'm new with this language.
    I have a class (with the object constructor)
    class TestClass{
    String data;
    public boolean equals(Object o) {
    if ((o != null) && (o instanceof TestClass)){
    System.out.println("ifffff");
    return data.equals(((TestClass)o).data);
    else{
    System.out.println("elseeeee");
    return false;
    and I have the class containing the main method and a method to remove an object from a linked list. The problem is that the program seems to use the "equals method" from Object and no the one I redefine in my TestClass method.
    Here is the code of my remove method. Please help (I'm sorry about the variables name I use but I'm writing the code in french)
    Object retirer(Object element){ 
    Noeud unNoeud;
    Noeud prec = null;
    Noeud tmp;
    if(estVide()){
    System.out.println("Op�ration r�fus�e. La liste est vide");
    else {
    for (unNoeud = premierNoeud; unNoeud != null; unNoeud = unNoeud.obtenirSuivant()){         
    if (!element.equals(unNoeud.obtenirElement())){
    // ------Even if they are equals, execution keeps entering here
    prec = unNoeud;
    else {
    if (unNoeud == premierNoeud)
    return premierNoeud.obtenirSuivant();
    else{
    tmp = unNoeud.obtenirSuivant();
    prec.majSuivant(tmp);
    return null;
    }

    sigh
    Crossposted:
    http://forum.java.sun.com/thread.jspa?threadID=624690

  • Problems accessing my compareTo method

    Could you any one help me on this please.
    I have 3 classes :
    1- "Test class" that creates the object (works fine) and redefines compareTo method
    2. "XListeChainee" that manage my linked list :
    - insert a new node (problems) in order
    3. "Test" which is the classe containing the main method. here is the code
    class Test {
    public static void test(){
    XListeChainee liste = new XListeChainee();
    liste.insererOrdonne(new TestClass("A"));
    liste.insererOrdonne(new TestClass("B"));
    liste.insererOrdonne(new TestClass("C"));
    liste.insererOrdonne(new TestClass("E"));
    liste.insererOrdonne(new TestClass("D"));
    // ------- here is the main method
    public static void main(String[] args){//main
    Test obj = new Test();/
    obj.test();
    }//end main
    here is the class TestClass with the compareTo method
    class TestClass implements Comparable{
    String data;
    TestClass(String data)
    this.data = data;
    }//end constructor
    public String toString(){
    return (data);
    public int compareTo(Object o) {
    TestClass n = (TestClass)o;
    int compData = data.compareTo(n.data);
    return compData ;
    }//end TestClass
    and this is my XListeChainee class (some of the code)
    public class XListeChainee
    private Noeud premierNoeud; //reference to first node
    private Noeud dernierNoeud; //reference to last node
    boolean estVide(){
    return premierNoeud == null;
    // ------ Insert an object: in order
    void insererOrdonne(Object element) {        
    // Creates a new node with the new element
    Noeud unNoeud;
    unNoeud = new Noeud();
    unNoeud.majElement(element) ;
    if ( premierNoeud == null ) { // if first node = null
    premierNoeud = unNoeud; // new node become first
    //------------------------- problem------------------------------
    //---- Compare the element in the first node with the element : Doesn't work
    // ---- System says that cannot resolve symbol - compareTo
    // This line says: if (firstNode.element.compareTo(element)>=0)
    else if ( premierNoeud.obtenirElement().compareTo(element) >= 0 ) {
    // Le nouvel element est < que le 1er element, alors il est inser� a la tete
    unNoeud.majSuivant(premierNoeud);
    premierNoeud = unNoeud;
    else {
    // Chercher la position du nouvel element dans la liste
    Noeud parcourir; // un noeud pour parcourir la liste
    Noeud prec; //un noeud toujour avant celui qui parcours la liste
    parcourir = premierNoeud.obtenirSuivant();
    prec = premierNoeud;
    while (parcourir != null && parcourir.obtenirElement().compareTo(element) < 0) {
    previous = parcourir;
    parcours = parcourir.obtenirSuivant();
    unNoeud.majSuivant(parcourir); // Insert newNode after previous.
    prec.majSuivant(unNoeud);
    Could you help me doing this please? I' sorry about some variable and method's names but I'm writing a program in french

    [snip]
    public int compareTo(Object o) {
    TestClass n = (TestClass)o;
    int compData = data.compareTo(n.data);
    return compData ;
    }//end TestClass[snip]
    : if (firstNode.element.compareTo(element)>=0)
    else if (
    e if (
    premierNoeud.obtenirElement().compareTo(element) >=0
    ) {What's up with the >=0 business in your method call?
    Based on what your method expects (an Object) I
    I don't know what you're trying to accomplish there?
    Also, please use code tags.Nevermind, after staring at it I can see the closing paranthesis now.

  • PLEASE HELP!!! "Payment method decline"

    Im from Malaysia and i have a problem with my payment registration. I've tried to register my Maybank Visa Debit for my payment while purchased at appstore, but it keep saying that " the payment method was decline and try other payment method". Why is it happen? Is it because i cant doing my purchase using visa debit? I've already call the bank and they said that my account already active for online shopping..please help me...i want to purchase fifa13 asap! Thanks...;)

    Azry9 wrote:
    ...my account already active for online shopping.....
    The iTunes Store is different...
    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • Accessing private class methods

    This program works, but I am having some problem grasping the concept. If class Room can access methods in class House using gethWidth() and getHeight(), why is it that class Type cannot access those same
    methods. Instead, it can only access setWidth() and
    setHeight()?
    class House {
    private double width;//width of room
    private double length;//length of the room
    double getWidth() {return width;}
    double getLength() {return length;}
    void setWidth(double w) {width=w;}
    void setLength(double l) {length=l;}
    void showdim() {
    System.out.println("My townhouse has two bedrooms.");
    class Room extends House {
    String bedroom;
    double area() {
    return getWidth() * getLength();
    void showBedroom() {
    System.out.println("The biggest room is the" + " " + bedroom + ".");
    class Type {
    public static void main(String args[]) {
    Room r1=new Room();
    Room r2=new Room();
    r1.setWidth(14.5);
    r1.setLength(20.6);
    r1.bedroom="master bedroom";
    r2.setWidth(15.2);
    r2.setLength(15.3);
    r2.bedroom="Guest Room";
    System.out.println();
    r1.showdim();
    r1.showBedroom();
    System.out.println();
    System.out.println("The area of the" + " " + r1.bedroom+ " " +
    "equals"+ " "+ r1.area()+ " " + "square feet.");
    }

    Thanks to all. But the comments provided so far does not answer my question. Over the past few days I have struggled over the question and I think I found the answer. Others are welcome to comment.
    Initially, "width" and "length" were decleared as private in class "House". For other classes to gain access, they had to use "accessor methods". Two accessor methods were decleared: "getWidth" and "getHeight"; and "setWidth" and "setLength". The first two methods "return"; the last two were "void". In class Room, I set up a method to return the calculation, so I used "getWidth and "getLength". In class "Type" I had to use the other method "setWidth", since I was declearing the actual values. Makes sense?

  • Please HELP ME ACCESS OR DELETE MY RESTRICTIONS PASSCODE COZ' EVERYTIME I ENTER MY RESTRICTIONS PASSCODE IT WILL SAYS.. PASSCODE ATTEMPT FAILED.. I AM ATTEMPTING TO ENTER MY RESTRICTIONS PASSCODE SINCE THIS MORNING AND UNTIL NOW I HAVE ENTERED 13 TIMES...

    Please.. HELP ME HOW TO DELETE OR RESET MY RESTRICTIONS PASSCODE BECAUSE EVERYTIME I ENTER MY RESTRICTIONS PASSCODE IT IS ALWAYS PASSCODE ATTEMPT FAILED... I AM STARTING THIS SINCE THIS MORNING BUT UNTIL NOW I CAN'T ACCESS MY RESTRICTIONS PASSCODE... I ENTERED 13 TIMES ALREADY SINCE THIS MORNING... BUT UNTIL NOW ITS USELESS.. I CAN'T VIEW MY OWN BUILT-IN APPS LIKE CAMERA, YOU TUBE, ITUNES, APPS, SAFARI, ICLOUD, TWITTER, FACETIME.... PLEASE HELP ME SOLVE MY PROBLEM ... PLEASE... THANK YOU SO MUCH...

    Please turn off your CAPS LOCK, it's considered shouting and therefore rude.
    If you have forgotten the restrictions passcode the phone will become locked and the only way to use it again will be to restore the phone to factory settings, which will wipe all data from the phone in the process. After restoring the phone you can then restaore it to the last backup that you made.

  • , please help problem downloading apps since update

    Why can't i download apps since i updated to i06, i  log in with password .am then asked for three security questions fill this out click done and get the answer timed out try again, what is causing this please help.

    Settings>General>Reset (at the far bottom)>Reset All Settings
    That will ALWAYS work for the "3 Security Questions - Timed Out problem".  No data will be lost, but your network settings will be reset.

  • Please help me for Calendar class

    Now i am working in SAP.Now we are doing Internal project for Company Timesheet of the employee,they are using Java,javascript,html,jsp,mysql.
    Please give Support for developing this task
    I am trying to do employee's timesheet( i.e. daily working hours).Here i attach my documents.here in that screen i am selecting fig1 calendar date for 19th july 2006 now we can see it in fig2 there we will see 15th july 2006 to 21st july 2006 is visible. The scnario is when ever we select the any of the day of the week we need to display whole week sun,mon to sat.
    when i am selecting (select week days by using javascript) total weekly working hours should come.please guide me and give me sample code.
    I think you understand what i am asking. using javascript calendar i am selecting the date.and from database i have to get the daily working hours of the perticular employee. I am not so familiar in java,that's why only i am asking .Please help me
    Advance thanks for You
    code i am pasting here
    thanks&Regards
    Vijaya
    ********** Java code******************
    import java.util.Calendar;
    import java.util.Date;
    class FirstAndLastDay4
    public static void main(String[] args)
    //int i=1;
    try{
    Calendar date=Calendar.getInstance();
    int day = date.get(Calendar.DAY_OF_WEEK);
    switch(day){
    case(1):
    { System.out.println("\n Input date [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK));
    System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    break;
    case(2):
    { System.out.println("\n Input date [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)-1);
    System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    break;
    case(3):
    { System.out.println("\n Input date [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)-2);
    System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    break;
    case(4):
    { System.out.println("\n Input date [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)-3);
    System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    break;
    case(5):
    { System.out.println("\n Input date [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)-4);
    System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    /*for(int i=0,j=1;i<7;i++)
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+i);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    break;
    case(6):
    { System.out.println("\n Input date [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)-5);
    System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+6);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    break;
    case(7):
    { System.out.println("\n Input date [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)-6);
    System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+6);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+1);
    System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
    break;
    }catch(Exception e){
    e.printStackTrace();
    }

    Hi All,
    I am trying to do employee's timesheet( i.e. daily working hours).Here i attach my documents.here in that screen i am selecting fig1 calendar date for 19th july 2006 now we can see it in fig2 there we will see 15th july 2006 to 21st july 2006 is visible. The scnario is when ever we select the any of the day of the week we need to display whole week sun,mon to sat.
    when i am selecting (select week days by using javascript) total weekly working hours should come.please guide me and give me sample code.
    Thanks in advance
    thanks & regards
    <code>
    import java.util.Calendar;
    import java.util.Date;
    class FirstAndLastDay
         public static void main(String[] args)
              try{
                   Calendar date=Calendar.getInstance();
                   int day = date.get(Calendar.DAY_OF_WEEK);
                   switch(day){
                        case(1):
                        {     System.out.println("\n Input date [" + new java.util.Date(date.getTimeInMillis()) + "]");
                             date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK));
                             System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
                             date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+6);                         
                             System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
                             break;
                        case(2):
                        {     System.out.println("\n Input date [" + new java.util.Date(date.getTimeInMillis()) + "]");
                             date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)-1);
                             System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
                             date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+6);                         
                             System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
                             break;
                        case(3):
                        {     System.out.println("\n Input date [" + new java.util.Date(date.getTimeInMillis()) + "]");
                             date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)-2);
                             System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
                             date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+6);                         
                             System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
                             break;
                        case(4):
                        {     System.out.println("\n Input date [" + new java.util.Date(date.getTimeInMillis()) + "]");
                             date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)-3);
                             System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
                             date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+6);                         
                             System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
                             break;
                        case(5):
                        {     System.out.println("\n Input date [" + new java.util.Date(date.getTimeInMillis()) + "]");
                             date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)-4);
                             System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
                             date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+6);                         
                             System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
                             break;
                        case(6):
                        {     System.out.println("\n Input date [" + new java.util.Date(date.getTimeInMillis()) + "]");
                             date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)-5);
                             System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
                             date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+6);                         
                             System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
                             break;
                        case(7):
                        {     System.out.println("\n Input date [" + new java.util.Date(date.getTimeInMillis()) + "]");
                             date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)-6);
                             System.out.println("First day [" + new java.util.Date(date.getTimeInMillis()) + "]");
                             date.set(Calendar.DAY_OF_WEEK, date.get(Calendar.DAY_OF_WEEK)+6);                         
                             System.out.println("Last day [" + new java.util.Date(date.getTimeInMillis()) + "]");
                             break;
              }catch(Exception e){
                   e.printStackTrace();
    </code>

  • Help: Problems accessing XML file in WebSphere 3.5 Fix Pack 4 on Solaris

    We are having an emergent issue with WebSphere 3. 5 Fix Pack 4 on Solaris 2.6: The WAR file we deployed fails with runtime exception due to the inability
    to access a local resource(XML file) in the converted WAR file's web directory.
    The way we access this XML file is as follows:
    ServletContext theCon = getServletContext();
    URL u = theCon.getResource ("/web/test.xml");
    String newPath = u.toExternalForm ();
    InputStream is = new URL (newPath).openStream();
    The InputStream returned from the URL object is NULL.
    After checked the URL's externalForm string, we noticed that its protocol part is "classloader", e.g. the whole URL string is like "classloader:/opt/...../web/test.xml". However, if we replaced "classloader" with "file", the problem disappeared and the XML file can be read without error.
    Anybody know why "classloader:" in the URL string cause this problem, and what is the solution without changing the URL string?
    Thanks a lot!

    Hi,
    Can you try to replace the two last lines with:InputStream is = new FileInputStream (u.getFile());Hope this helps,
    Kurt.

Maybe you are looking for

  • Partial coupon payments

    Hi, Gurus I came accross a problem. Hope for your piece of advice We have got some bonds and the issuer paid a coupon amount partialy - different amounts and dates. Eg, we have got coupon flow $100 on 01.05.2011 which is in fact paid by the issuer wi

  • No attribute appear in new custom VSA RADIUS

    Hi, I use Cisco Secure version 3.2 on windows 2000 I just had a new custom VSA Radius with the utility CSUtil.exe Fist i create the file myvsa.ini, this is for a SONET optical Nortel equipement, here it is: [User Defined Vendor] Name=OM3000 IETF Code

  • I have a 4630e and I want to print out the report of my paper useage for the month.

    I have a 4630, 3-in-one. I'm in the automatic refill program.  I want to get to and print the report of useage for the month to see if I can reduce the among of pap I have allotted myself. This question was solved. View Solution.

  • Macbook Pro 17 inch RAM limitation?

    Hi, I am using MBP 17inch 2.5GHz core 2 duo. I wanted to upgrade my ram from 2GB to 4GB, so i bought 2x2GB Kingston ram, DDR2 667Mhz. But when i installed both, my computer does not start up! but when i replaced one of the new 2gb ram with the older

  • Flash CS4 installation CD not working

    I have had to uninstall and reinstall my Flash Pro CS4 software several times.  The last time my computer died and I had to reinstall the installation keeps getting stuck a few minutes in.  It gives me no error, just stops installing. Since I have a