My first step in Java, please help me.

I've just installed J2SDK1.4.0_03 and I'm reading the first pages of the Java tutorial.
I've created a work folder : C:\Java
I'm working with an msdos session of windows 2000
I've created my first example class, prthello.java with NotePad :
class prthello{
public static void main(String args[]) {
System.out.println("Hello World!");
I've successful compilated it (javac prthello.java) and generated the prthello.class
I've tried to execute it (java prthello) but it doesn't work and i receive the following message :
Exception in thread "main" java.lang.NoClassDefFoundError: prthello
The path should be correct (C:\Programmi\j2sdk1.4.0_03\bin) ,
any suggestions would be appreciate.
Thanking in Advance
Andrea Giussani
Milano, Italy

Thank you for your suggestions, but i have already checked.
The path is ok, i've installed jsdk under folder "programmi" and the path is :
C:\>set path
Path=C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\PROGRA~1\IBM\CLIENT~1;
C:\PROGRA~1\IBM\CLIENT~1\Shared;C:\PROGRA~1\IBM\CLIENT~1\Emulator;C:\Programmi\F
ile comuni\Autodesk Shared\;C:\Programmi\j2sdk1.4.0_03\bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
prthello.java and prthello.class are in the same folder (C:\java) where i executed javac with success and java with the error above mentioned.
Any other suggestions ? Should I reinstall the JSDK ?
Thanking in advance,
Andrea Giussani

Similar Messages

  • Pascal to Java Please help me!

    I am truobled in creating a validation method for the user loging in....
    As I am perfect at Pascal can anyone translate the following pascla code to Java Please help me with this.
    PROGRAM USERLOGIN;
    TYPE
      USER_TYPE = RECORD
        USERNAME : STRING[15];
        PASSWORD : STRING[15];
    END;
        USFILE = FILE OF USER_TYPE;
    VAR
       USER: USER_TYPE;
       CKUSER: USER_TYPE;
       RECFILE : USFILE;
       I,J     : INTEGER;
    BEGIN
    WRITE('ENTER USERNAME:');READLN(CKUSER.USERNAME);
    WRITE('ENTER PASSWORD:');READLN(CKUSER.PASSWORD);
    FILESPEC :='USERFILE.USR';
    ASSIGN(RECFILE, FILESPEC);
    RESET(RECFILE);
      WHILE NOT EOF(RECFILE) DO
       BEGIN
         READ(RECFILE, USER);
         IF CKUSER.USERNAME = USER.USERNAME AND CKUSER.PASSWORD = USER.PASSWORD THEN
              LOGIN
        ELSE
              WRITE('USER NOT FOUND');
       END;
    END.Thank you

    Don't bother:
    http://forum.java.sun.com/thread.jsp?forum=54&thread=539277

  • Why the same name of process comes out in AIX , in java. please help me.

    Hello.
    I have two questions related to Jvm.
    I've developed Job scheduler program which is doing somthing as the DB schedule is set in the way of Multi
    thread. Currently , I'm in the process of testing this one. It is good , if in the normal case. However, When
    doing Shell, if the application have so a lot to do the Shell, it has a little problem.
    My developing environment is
    OS : AIX 5.3
    JRE : IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 AIX ppc-32 jvmap3260sr7-20091214_49398
    (JIT enabled, AOT enabled)
    nofiles(descriptors) 2000
    maxuproc 4096 Maximum number of PROCESSES allowed
    per user True
    In order to execute Shell in My Scheduler program , I tested Runtimeexec() or ProcessBuilder.
    The result of mine in the test , when the executed Shell got over 300 is
         1. The jvm processes that I execute at the first time are shown up , after Shell go to the finish, the
    processes are all in the disappearance again , and at last The processes that I executed at the first time are
    remaining. It's like the process is duplicated process in the maximum of 70.
    When I do shell about 200 to be executed simultaneously, Duplicated jvm about 3 appeared momentarily, then
    disappeared, and also under 120, No duplicated case is found when under 120.
    ps -ef result is below , when shell is excuted
    UID PID PPID C STIME TTY TIME CMD
    jslee 626906 1 0 11, May - 2:20 java -
    DD2_JC_HOME=/source/jslee/JOB -Dfile.encoding=euc-kr jobserver.JobServerMain
    jslee 1421522 626906 0
    19:36:16 - 0:00 java -DD2_JC_HOME=/source/jslee/JOB -Dfile.encoding=euc-kr jobserver.JobServerMain
    ....Skip.....
    jslee 4374620 626906 0 19:34:06 - 0:00 java -DD2_JC_HOME=/source/jslee/JOB -
    Dfile.encoding=euc-kr jobserver.JobServerMain
    (the process list about 60)
    *the first question : Why a lot of duplicated jvm are shown up when in alot of shell to be executed ?
    *the second question : As you can see above , How can I solve out the problem.
    *Is there some option that I can set up when starting Jvm?
    ---Next question---
    My developing environment is
    OS : SunOS 5.8
    JRE : Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
    Java HotSpot(TM) Server
    VM (build 16.0-b13, mixed mode)
    nofiles(descriptors) 256
    As shown obove , the value of descriptors is 256 .
         My scheduler program executed 300 shell at the same time, in result my program was abnormalily
    terminated after doing shell about 180.
    the Exception info is
    java.io.IOException: Cannot run program "sh": error=24, exceeding the number of opened files
         at
    java.lang.ProcessBuilder.start(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at
    java.lang.Runtime.exec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
    or
    java.net.SocketException: exceeding the number of opened files     at java.net.PlainSocketImpl.socketAccept
    (Native Method)
    또는
    java.io.IOException: exceeding the number of opened files     at
    java.io.UnixFileSystem.createFileExclusively(Native Method)
         at java.io.File.checkAndCreate(Unknown
    Source)
         at java.io.File.createTempFile(Unknown Source)
    *question : If I continuously request to open a file that go over system limit, is it possible for JVM to be
    terminated?
    *question : Is there a method that obtains state of System limit in the java library.
    *question : what is the best solution to cope with ?
    Please help me
    =

    struts-config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
    <struts-config>
      <form-beans>
           <form-bean name="registrationForm" type="ndlinh.struts.lab.RegistrationForm" />
      </form-beans>
      <action-mappings>
           <action path="/register"
                   type="ndlinh.struts.lab.RegistrationAction" // action class
                   name="registrationForm" // form bean name
                   validate="false"
                   scope="request"
                   input="registration.jsp" >
                <forward name="success" path="/jsp/success.jsp"  />
                <forward name="failure" path="/jsp/failure.jsp"  />
           </action>
      </action-mappings>
    </struts-config>HTH

  • Very new to java please help

    i'm very new to java and i'm getting an error in my application. i took 4 applications that compiled and worked separatly and i tried to combine them into one application. i'm getting the error: unreported exception java.io.IOException; must be caught or declared to be thrown, in lines 73,78,83,88,120,146,149,152,155 in the and it points at the keyboard.readLine() but everything i've tried just gives me more errors. please help anything and everything will be greatly appreciated. here it is, sorry about format i dunno how to straighten it in here:
    // ^ ^
    //               (0)(0) A Happy Piggy Application
    // Problems: 2.6,2.8,2.9,2.12 (oo)
    // An application finds the total number of hours, minutes, & seconds, finds the distance
    // between two points, finds the volume and surface area of a sphere, and adds up the change
    // in a jar. First, the total hours, minutes, and seconds problem.
    import java.io.*;
    import java.text.DecimalFormat;
    import java.text.NumberFormat;
    public class twoptsix
         static BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in));
         static PrintWriter screen = new PrintWriter(System.out, true);
         public static void main (String[] args) throws IOException
              double hoursa, minutesa, secondsa;
              String hours;
              System.out.print ("Please enter a number of hours: ");
    hours = keyboard.readLine();
    hoursa = Double.parseDouble(hours); //asks programmer friendly user to enter hours
    String minutes;
    System.out.print ("Please enter a number of minutes: ");
    minutes=keyboard.readLine();
    minutesa = Double.parseDouble(minutes); //asks programmer friendly user to enter minutes
    String seconds;
    System.out.print ("Pretty please enter a number of seconds: ");
    seconds = keyboard.readLine();
    secondsa = Double.parseDouble(seconds); //asks programmer friendly user to enter seconds
    double allseconds;
    allseconds = (hoursa * 3600) + (minutesa * 60) + secondsa; //adds up all the seconds of the time entered
    System.out.println ("You have: " + hours + " hours..."); //displays hours
    System.out.println ("" + minutes + " minutes..."); //displays minutes
    System.out.println ("and " + seconds + " seconds..."); //displays seconds
              System.out.println ("to get whatever you need to done!"); //witty attempt at humor
    System.out.println ("The total amount of seconds is: " + allseconds + " seconds."); //displays total seconds
    // An application that finds the distance between two points when the points
    // are given by the user.
              double x1, x2, y1, y2, total, distance;
              String xa;
              System.out.print ("Please enter the 'x' coordinate of first point: ");
              xa = keyboard.readLine();
              x1 = Double.parseDouble(xa); //asks programmer friendly user to enter first x value
              String ya;
              System.out.print ("...also need the 'y' coordinate of first point: ");
              ya = keyboard.readLine();
              y1= Double.parseDouble(ya); //asks programmer friendly user to enter first y value
              String xb;
              System.out.print ("...and the 'x' coordinate of the second point: ");
              xb = keyboard.readLine();
              x2 = Double.parseDouble(xb); //asks programmer friendly user to enter second x value
              String yb;
              System.out.print ("...don't forget the 'y' coordinate of the second point: ");
              yb = keyboard.readLine();
              y2 = Double.parseDouble(yb); //asks programmer friendly user to enter second y value
              total = Math.pow(x2 - x1, 2.0) + Math.pow(y2 - y1, 2.0); //squares the differences of values
              distance = Math.sqrt(total); //finds the square root of the sum of the differences of the values
              System.out.print ("E=mc^2...oh and,");
              System.out.print ("the distance between point (" + xa +"," + ya +") and point("+
              xb + "," + yb + ") is : " + distance);
    // An application that takes the radius of a sphere and finds and prints
    // the spheres volume and surface area.
              double radius,volume,area;
              String rad;
              System.out.print("Please enter the radius of a sphere: ");
              rad = keyboard.readLine();
              radius = Double.parseDouble(rad); //asks programmer friendly user to enter the radius of a sphere
    DecimalFormat fmt = new DecimalFormat ("0.####");
              volume = ((4 * Math.PI * Math.pow(radius,3.0)) / 3) ;
              System.out.println (" The sphere has a volume of:" + fmt.format(volume)); //finds and displays volume
              area = ( 4 * Math.PI * Math.pow(radius, 2.0)) ;
              System.out.print (" The Surface Area of the sphere is: " + fmt.format(area)); //finds and displays surface area
    // An application that finds the total, in dollars and cents, of a number of quarters,
    // nickels, dimes, and pennies in your piggy bank.
              int pennies, nickels, dimes, quarters;
              double money1;
              screen.println("Empty your piggy bank and count the change, how many quarters ya have?: ");
              int q = (new Integer(keyboard.readLine())).intValue();//asks programmer friendly user to enter a number of quarters
              screen.println("How many dimes?: ");
              int d = (new Integer(keyboard.readLine())).intValue();//asks programmer friendly user to enter a number of dimes
              screen.println("How many nickels?: ");
              int n = (new Integer(keyboard.readLine())).intValue();//asks programmer friendly user to enter a number of nickels
              screen.println("How many pennies?: ");
              int p = (new Integer(keyboard.readLine())).intValue();//asks programmer friendly user to enter a number of pennies
              NumberFormat money = NumberFormat.getCurrencyInstance();
              money1 = (.25 * q) + (.1 * d) + (.05 * n) + (.01 * p);
              screen.println("You're rich! Total, you've got: " + money.format(money1));//finds and displays total money

    Ok here is the working code as one long function:
    // ^ ^
    // (0)(0) A Happy Piggy Application
    // Problems: 2.6,2.8,2.9,2.12 (oo)
    // An application finds the total number of hours, minutes, & seconds, finds the distance
    // between two points, finds the volume and surface area of a sphere, and adds up the change
    // in a jar. First, the total hours, minutes, and seconds problem.
    import java.io.*;
    import java.text.DecimalFormat;
    import java.text.NumberFormat;
    public class twoptsix
        static BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in));
        static PrintWriter screen = new PrintWriter(System.out, true);
        public static void main (String[] args) throws IOException
    double hoursa, minutesa, secondsa;
    String hours;
    System.out.print ("Please enter a number of hours: ");
    hours = keyboard.readLine();
    hoursa = Double.parseDouble(hours); //asks programmer friendly user to enter hours
    String minutes;
    System.out.print ("Please enter a number of minutes: ");
    minutes=keyboard.readLine();
    minutesa = Double.parseDouble(minutes); //asks programmer friendly user to enter minutes
    String seconds;
    System.out.print ("Pretty please enter a number of seconds: ");
    seconds = keyboard.readLine();
    secondsa = Double.parseDouble(seconds); //asks programmer friendly user to enter seconds
    double allseconds;
    allseconds = (hoursa * 3600) + (minutesa * 60) + secondsa; //adds up all the seconds of the time entered
    System.out.println ("You have: " + hours + " hours..."); //displays hours
    System.out.println ("" + minutes + " minutes..."); //displays minutes
    System.out.println ("and " + seconds + " seconds..."); //displays seconds
    System.out.println ("to get whatever you need to done!"); //witty attempt at humor
    System.out.println ("The total amount of seconds is: " + allseconds + " seconds."); //displays total seconds
    // }  <----- MAIN FUNCTION USED TO END HERE!!!
    //but we want to keep going so remove the bracket!
    // An application that finds the distance between two points when the points
    // are given by the user.
    // {  <-- other function used to start here, but now it continues
    double x1, x2, y1, y2, total, distance;
    String xa;
    System.out.print ("Please enter the 'x' coordinate of first point: ");
    xa = keyboard.readLine();
    x1 = Double.parseDouble(xa); //asks programmer friendly user to enter first x value
    String ya;
    System.out.print ("...also need the 'y' coordinate of first point: ");
    ya = keyboard.readLine();
    y1= Double.parseDouble(ya); //asks programmer friendly user to enter first y value
    String xb;
    System.out.print ("...and the 'x' coordinate of the second point: ");
    xb = keyboard.readLine();
    x2 = Double.parseDouble(xb); //asks programmer friendly user to enter second x value
    String yb;
    System.out.print ("...don't forget the 'y' coordinate of the second point: ");
    yb = keyboard.readLine();
    y2 = Double.parseDouble(yb); //asks programmer friendly user to enter second y value
    total = Math.pow(x2 - x1, 2.0) + Math.pow(y2 - y1, 2.0); //squares the differences of values
    distance = Math.sqrt(total); //finds the square root of the sum of the differences of the values
    System.out.print ("E=mc^2...oh and,");
    System.out.print ("the distance between point (" + xa +"," + ya +") and point("+
         xb + "," + yb + ") is : " + distance);
    //second function used to end here...
    //} <--- COMMENT OUT BRACKET SO WE CONTINUE
    // An application that takes the radius of a sphere and finds and prints
    // the spheres volume and surface area.
    //{ <--- ANOTHER ONE TO COMMENT OUT
    double radius,volume,area;
    String rad;
    System.out.print("Please enter the radius of a sphere: ");
    rad = keyboard.readLine();
    radius = Double.parseDouble(rad); //asks programmer friendly user to enter the radius of a sphere
    DecimalFormat fmt = new DecimalFormat ("0.####");
    volume = ((4 * Math.PI * Math.pow(radius,3.0)) / 3) ;
    System.out.println (" The sphere has a volume of:" + fmt.format(volume)); //finds and displays volume
    area = ( 4 * Math.PI * Math.pow(radius, 2.0)) ;
    System.out.print (" The Surface Area of the sphere is: " + fmt.format(area)); //finds and displays surface area
    // } <----- COMMENTED OUT FOR THE SAME REASON
    // An application that finds the total, in dollars and cents, of a number of quarters,
    // nickels, dimes, and pennies in your piggy bank.
    //{ <----AND ANOTHER
    int pennies, nickels, dimes, quarters;
    double money1;
    screen.println("Empty your piggy bank and count the change, how many quarters ya have?: ");
    int q = (new Integer(keyboard.readLine())).intValue();//asks programmer friendly user to enter a number of quarters
    screen.println("How many dimes?: ");
    int d = (new Integer(keyboard.readLine())).intValue();//asks programmer friendly user to enter a number of dimes
    screen.println("How many nickels?: ");
    int n = (new Integer(keyboard.readLine())).intValue();//asks programmer friendly user to enter a number of nickels
    screen.println("How many pennies?: ");
    int p = (new Integer(keyboard.readLine())).intValue();//asks programmer friendly user to enter a number of pennies
    NumberFormat money = NumberFormat.getCurrencyInstance();
    money1 = (.25 * q) + (.1 * d) + (.05 * n) + (.01 * p);
    screen.println("You're rich! Total, you've got: " + money.format(money1));//finds and displays total money
    }P.S. To make the code formatted better put [ code ] before and [ /code ] after. It's not perfect, but a little better...

  • I'm trying to print out a credit card statement from my iPad, it only prints the first page not 4pages, please help

    I'm trying to print out a credit card statement from my iPad, it only prints the first page not the 4 pages, please help

    I read your first post when I was posing a separate question on the Mac Pro board.  I now see that we may be talking about printing from an iPad with Airprint instead!!!!!  I very much suspect the print command and settings are different for Airprint but I have never used it to be able to offer concrete advice.  I think the setting choices could be different even with Airprint on the laptop and further that you may not even be using Safari but some special app???
    I've not heard or seen the term "frame" in the context of printing before except perhaps in the context of a screen shot.  Is the credit card statement a "pop-up" of some kind rather than a webpage or pdf?

  • M new to this forum + new to java please help me with file handling program

    hi i want to make a file handling program where in i want to input a text file say f1 whose style is mentioned as below
    aaa...bcd
    aaabbc
    acdce
    a..dd
    abbcd
    now i want to write d out put of file f1 to file f2 but only those string entries widout any ... in them how to do that :-(( please help :((

    import java.io.*;
    import java.lang.*;
    class javcsse{
             void javsce (){
              BufferedReader in;
            PrintWriter out;
            String line;
            try
                in = new BufferedReader(new FileReader("e:\\cntcs\\n7.txt"));
                out = new PrintWriter("e:\\cntcs\\n8.txt");
               line = in.readLine();
               while(line != null)
                     if(line.contains("...") && line.contains("....")){
                         break ;                
                         else{
                               if(line.contains("cc"))
                              System.out.println(line+"\n");
                                      out.println(line);
                    line = in.readLine();
                in.close();
                out.close();
            } catch (Exception ex)
                System.err.println(ex.getMessage());
      public class javcse{
        public static void main(String[] args) {
            new javcsse();
    }hey i wrote this code yet could u tell y is it still not working :((

  • I'm trying to print a multiple page document from my ipad using an Airprint printer. Only the first page is printing, Please help?

    I'm trying to print a multiple page document from my ipad using an AirPrint printer. Only the first page is printing. Please help. The printer works correctly with my desktop and laptop.

    What version of iOS are you using?  Some people were having this problem before, and it was fixed when they updated to iOS 5.

  • I am new to java please help!!

    please help ive got a method thta i wanto to use it in another class, but it does not work.
    //prueba.java
    import java.io.*;
    public class prueba
    public int numero3;
    public int suma(int numero1,int numero2)
    int numero3=numero1+numero2;
    return numero3;
    //prueba1.java
    import javax.servlet.*;
    import java.io.*;
    import javax.servlet.http.*;
    import prueba;
    public class prueba1 extends HttpServlet
    public void doGet(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    PrintWriter out = res.getWriter();
    int num1=1;
    int num2=1;
    prueba uno=new prueba();
    out.println(uno.suma(2,3));
    when i ty to complie this file it throws me thie errors:
    C:\resin-2.0.b2\doc\content-manager\admin\web-inf\classes\prueba1.java:4: cannot resolve symbol
    symbol: class prueba
    import prueba;
    ^
    C:\resin-2.0.b2\doc\content-manager\admin\web-inf\classes\prueba1.java:15: cannot resolve symbol
    symbol : class prueba
    location: class prueba1
    prueba uno=new prueba();
    ^
    C:\resin-2.0.b2\doc\content-manager\admin\web-inf\classes\prueba1.java:15: cannot resolve symbol
    symbol : class prueba
    location: class prueba1
    prueba uno=new prueba();
    ^
    3 errors
    Tool completed with exit code 1
    both , prueba1.java and prueba.java are in the same folder.

    C:\resin-2.0.b2\doc\content-manager\admin\web-inf\classes\prueba1.java:15: cannot resolve symbol
    symbol : class prueba
    location: class prueba1
         prueba uno=new prueba();
    ^
    C:\resin-2.0.b2\doc\content-manager\admin\web-inf\classes\prueba1.java:15: cannot resolve symbol
    symbol : class prueba
    location: class prueba1
         prueba uno=new prueba();
    ^
    2 errors

  • I cannot get my zagg folio to work with splashtop 2...need step by step directions!  Please help!

    Does the zagg folio work with the splash top 2 on my ipad?  I try to type and the screen is frozen.  However I can type from my windows pc and it shows up just fine on the ipad?  What am I doing wrong or what step by step directions have I missed?  Please help as I am a college student and need help!  Thank YOU.

    Does the zagg folio work with the splash top 2 on my ipad?  I try to type and the screen is frozen.  However I can type from my windows pc and it shows up just fine on the ipad?  What am I doing wrong or what step by step directions have I missed?  Please help as I am a college student and need help!  Thank YOU.

  • Recursion in java. please help

    I am writing a program for tree traversing as follows. The program is relatively long but please just focus on 2 lines with errors indicated.
    import java.io.*;
    import myBinaryTree;
    class myBinaryTreeTest{
         static int vertexArray[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 1, 3, 3, 7, 9, 11, 5, 11};     
         static myBinaryTree treeArray[] = new myBinaryTree[10];
         static myBinaryTree tree;
         static pTwoChildNode nodeParent, nodeLeft, nodeRight;
         static treeNodeData dataParent, dataLeft, dataRight;
         public static void main(String[] args) {
         for (int j=0; j<10; j++) {
         treeArray[j]=new myBinaryTree();
    boolean treeArrayEmpty;
    int treeArrayEmptyIndex;
    int treeArrayChildIndex, treeArrayParentIndex;
              int vertexCollapseChild, vertexCollapseParent;
              for (int i=0; i<20; i=i+2) {
    vertexCollapseChild=vertexArray;
    vertexCollapseParent=vertexArray[i+1];
    treeArrayEmptyIndex=-1;
    treeArrayChildIndex=-1;
              treeArrayParentIndex=-1;          
              for (int j=0; j<10; j++) {
                   if (treeArray[j].isEmpty()) {
    if (treeArrayEmptyIndex == -1) {
    treeArrayEmptyIndex=j;
    else {
    dataParent = (treeNodeData)treeArray[j].getData();
                   if (vertexCollapseChild==dataParent.vertex)
    {treeArrayChildIndex=j;};
    if (vertexCollapseParent==dataParent.vertex)
    {treeArrayParentIndex=j;};
    if (treeArrayChildIndex != -1 && treeArrayParentIndex != -1)
                        {break;}
    updateTreeArray(treeArrayChildIndex, treeArrayParentIndex,
                        treeArrayEmptyIndex, vertexCollapseChild,
    vertexCollapseParent);
              for (int j=0; j<10; j++) {                                               
                   System.out.println("\nIn-order:");
                   preOTrav(treeArray[j].getRoot());
         static void updateTreeArray(int c, int p, int e, int cc, int cp) {
                                  // c=treeArrayChildIndex
                                  // p=treeArrayParentIndex
                                  // e=treeArrayEmptyIndex
                                  // cc=vertexCollapseChild
                                  // cp=vertexCollapseParent
    System.out.println(c+" "+p+" "+e+" "+cc+" "+cp);
         if (c != -1) {
    if (p != -1) {
         dataParent = new treeNodeData();
              dataRight = (treeNodeData)treeArray[p].getData();
    dataParent.vertex=dataRight.vertex;
              nodeParent=new pTwoChildNode(dataParent);
    nodeParent.setLeft(treeArray[c].getRoot());
    nodeParent.setRight(treeArray[p].getRoot());
    treeArray[Math.min(c, p)].setRoot(nodeParent);
    treeArray[Math.max(c, p)].setRoot(null);
         else
              dataParent = new treeNodeData();
    dataParent.vertex=cp;
              nodeParent=new pTwoChildNode(dataParent);
    nodeParent.setLeft(treeArray[c].getRoot());
              dataRight = new treeNodeData();
    dataRight.vertex=cp;
              nodeParent.setRight(new pTwoChildNode(dataRight));
    treeArray[Math.min(c, e)].setRoot(nodeParent);
              treeArray[Math.max(c, e)].setRoot(null);
    else
    if (p != -1) {
    dataParent = new treeNodeData();
    dataRight = (treeNodeData)treeArray[p].getData();
    dataParent.vertex=dataRight.vertex;
              nodeParent=new pTwoChildNode(dataParent);
    dataLeft = new treeNodeData();
    dataLeft.vertex=cc;
    nodeParent.setLeft(new pTwoChildNode(dataLeft));
    nodeParent.setRight(treeArray[p].getRoot());
    treeArray[Math.min(p, e)].setRoot(nodeParent);
              treeArray[Math.max(p, e)].setRoot(null);
              else {
    dataParent=new treeNodeData();
    dataParent.vertex=cp;
              nodeParent=new pTwoChildNode(dataParent);
    dataRight=new treeNodeData();
    dataRight.vertex=cp;
              nodeRight=new pTwoChildNode(dataRight);
    nodeParent.setRight(nodeRight);
    dataLeft=new treeNodeData();
    dataLeft.vertex=cc;
              nodeLeft=new pTwoChildNode(dataLeft);
    nodeParent.setLeft(nodeLeft);
    treeArray[e].setRoot(nodeParent);
         static void preOTrav(pTwoChildNode n) {
              if (n == null)
              return;
              dataParent=(treeNodeData)n.getData();
              System.out.print(dataParent.vertex+" ");
              preOtrav(n.getLeft());
              preOtrav(n.getRight());
    //problems are here!!!!!
    class treeNodeData {
         int vertex;
         // data element2 -> a set of vertex fan;
    It doesn't compile but with the message saying that can not resolve the symbol in preOTrav(n.getLeft()); and preOTrav(n.getRight());
    Please help!

              preOtrav(n.getLeft());
              preOtrav(n.getRight());Don't write preOtrav when you mean preOTrav. Java is case-sensitive.
    Jesper

  • Totally New in Java - Please help!!

    Hi Dear all,
    l am totally new in Java, and l facing one problem,and really hope can get some help from yours,please!
    l need to write this program:
    The program should do the following:
    1. Input two fields: action (action: add / delete), and account number (any
    digit or character)
    2. if the action is "add" then the program adds one text line to a text
    file.
    "New account is <account number>"
    3. create the text file if it is not already exist (in c:\)
    4. When program runs again with new input values, a new line will be
    appended to the same file.
    5. if the action is "delete" then the program finds the record and removes
    the text line from the file.
    My problem is :
    l just know that l need to create the user interface first,but l don't know how to go on??
    Would you please show me some step how to solve these problem?
    Many many thanks!!
    BaoBao

    I don't know about Swing. I never use it.
    The stuff to create and manipulate files is in the java.io package.
    You'll probably want to use java.io.FileReader and java.io.FileWriter.
    Note that FileWriter has a constructor that lets you append and not overwrite.
    I'll start you off with a test.
    public class AccountListAddTest() {
      public static void main(String[] argv) {
        AccountList accts = new AccountList();
        accts.add("abcdefg12345"); // arg is a hypothetical account number
    }Write an AccountList class that'll work if you compile and run this test. After you run this test for the first time, the file should contain the string
    New account is abcdefg12345.
    This test assumes that the filename is hardcoded into the AccountList class. To keep it simple, make the add method create a new appending FileWriter each time, write, then close the writer.

  • New to Java, Please help

    Hi, I was trying to play a game and came up with this java error (below), I uninstalled and reinstalled still no fix. I think i need a new class?, If anyone can explain the potential problem to me and help me fix it, that would be much appreciated. I'm a complete NEWB when it comes to java, I'm not even sure how to edit that code. so please remember to explain in the newbiest of newby answers. I am proficient with features of a computer just not java.
    Java Plug-in 1.6.0_24
    Using JRE version 1.6.0_24-b07 Java HotSpot(TM) Client VM
    User home directory = C:\Users\Ethan
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    load: class loader.class not found.
    java.lang.ClassNotFoundException: loader.class
    at sun.plugin2.applet.Applet2ClassLoader.fi… Source)
    at sun.plugin2.applet.Plugin2ClassLoader.lo… Source)
    at sun.plugin2.applet.Plugin2ClassLoader.lo… Source)
    at sun.plugin2.applet.Plugin2ClassLoader.lo… Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.lo… Source)
    at sun.plugin2.applet.Plugin2Manager.create… Source)
    at sun.plugin2.applet.Plugin2Manager$Applet… Source)
    at java.lang.Thread.run(Unknown Source)
    Exception: java.lang.ClassNotFoundException: loader.class

    845681 wrote:
    Hi, I was trying to play a game and came up with this java error (below), I uninstalled and reinstalled still no fix. I think i need a new class?, If anyone can explain the potential problem to me and help me fix it, that would be much appreciated. I'm a complete NEWB when it comes to java, I'm not even sure how to edit that code. so please remember to explain in the newbiest of newby answers. I am proficient with features of a computer just not java.If you want to learn how to program java, which is not the same as playing that particular game then you can start with the following link.
    http://download.oracle.com/javase/tutorial/getStarted/index.html

  • Trying to simplify multiple steps into one - please help

    I have a set up of steps to perform on 3 tables in order to populate two tables, please suggest best way (performance wise) to do this
    CREATE TABLE AE
      EID    VARCHAR2(100 BYTE),
      UKEY   VARCHAR2(1000 BYTE),
      TNAME  VARCHAR2(10 BYTE)
    CREATE TABLE TAB1V
      PID    VARCHAR2(100 BYTE),
      PUKEY  VARCHAR2(100 BYTE)
    (join ae and tab1v with this condition: ae.ukey = tab1v.pukey);
    CREATE TABLE PES
      EID    VARCHAR2(100 BYTE),
      UKEY   VARCHAR2(100 BYTE),
      TNAME  VARCHAR2(1000 BYTE)
    (join condition with other tables, use ukey)
    insert into ae (eid,ukey,tname) values ('eid1','ukey123','tname123');
    insert into ae (eid,ukey,tname) values ('eid2','ukey123','tname123');
    insert into ae (eid,ukey,tname) values ('eid3','ukey222','tname222');
    insert into ae (eid,ukey,tname) values ('eid4','ukey222','tname222');
    insert into ae (eid,ukey,tname) values ('eid5','ukey456','tname456');
    insert into ae (eid,ukey,tname) values ('eid6','ukey789','tname789');
    insert into ae (eid,ukey,tname) values ('eid7','ukey789','tname7891');
    insert into pes(eid,ukey,tname) values('eid2','ukey123','tname123');
    insert into pes(eid,ukey,tname) values('eid6','ukey789','tname789');
    insert into pes(eid,ukey,tname) values('eid5','ukey456','tname456');
    insert into pes(eid,ukey,tname) values('eid2','ukey123','tname123');
    insert into tab1v(pid,pukey) values ('pid1','ukey123');
    insert into tab1v(pid,pukey) values ('pid2','ukey222');
    insert into tab1v(pid,pukey) values ('pid3','ukey111');
    insert into tab1v(pid,pukey) values ('pid4','ukey456');
    insert into tab1v(pid,pukey) values ('pid5','ukey789');my goal:
    i have to populate two tables
    1. result_table
    CREATE TABLE RESULT_TABLE
    PID VARCHAR2(100 BYTE),
    UKEY VARCHAR2(100 BYTE),
    EID VARCHAR2(100 BYTE),
    TNAME VARCHAR2(100 BYTE),
    SRC VARCHAR2(4 BYTE)
    2. no_match table
    CREATE TABLE NO_MATCH
    PID VARCHAR2(100 BYTE),
    UKEY VARCHAR2(100 BYTE),
    my flow of logic:
    1. check all the rows that are common to both tab1v and ae table (by joining with ukey),
    if there are ukeys that are present in tab1v table, but absent in ae table, populate
    them in no_match table, I got this with below query
    select pid,pukey from tab1v
    where not exists
    (select ukey from ae
    where ae.ukey = tab1v.pukey);
    result of no_match table should be:
    pid3 ukey111
    for all those rows that match, probably populate in a staging table
    CREATE TABLE STG_TABLE1
    PID VARCHAR2(20 BYTE),
    UKEY VARCHAR2(100 BYTE),
    TNAME VARCHAR2(100 BYTE),
    EID VARCHAR2(100 BYTE)
    insert into stg_table1(pid,ukey,eid,tname)
    select a.pid,b.ukey,b.eid,b.tname
    from tab1v a, ae b
    where A.PUKEY = b.ukey
    2.After doing point 1, So if I find common rows in both tab1v and ae table (present in stg_tab1), pick up those records and check if they are present in pes table ?
    join stg_table1 and pes table with ukey again
    3. populate records found / and not found in point 2, do the following check and populate result_table
    for records found in both stg_table1 (in other words, present in both ae and tab1v) and pes, do the following check
    if each ukey has multiple same tnames attached to it (ukey123 has tname123, twice ), src should be A
    if there is unique tname per ukey (ukey456 has only tname456), src should be A
    if each ukey has multiple different tnames (ukey 789 has tname789 and tname7891), they should be populated and src column should be B
    result_table should be like below :
    PID     UKEY     EID     TNAME SRC
    pid1     ukey123     eid1     tname123 A
    pid1     ukey123     eid2     tname123 A
    pid4     ukey456     eid5     tname456 A
    pid5     ukey789     eid6     tname789       B
    pid5     ukey789     eid7     tname7891      B
    pid2     ukey222     null     tname222 A
    pid2     ukey222     null     tname222 A
    for records found in stg_table1 but absent in pes, populate the above table and same following check, but assign null to eid : (last 2 rows in above data)
    following can be used to find difference
    select pid,ukey,tname from stg_table1
    where not exists
    (select ukey from pes
    where pes.ukey = stg_table1.ukey);
    if each ukey has multiple same tnames attached to it (ukey222 has tname222, twice ), src should be A
    if there is unique tname per ukey src should be A
    if each ukey has multiple different tnames they should be populated and src should be B (none in my example data)
    I am getting the results in individual sql statements, but how do I populate result_table and no_match with above data, given the above source data with minimal sql statements and considering performace as a key factor ?

    Why so many unanswered questions? 66 (47 unresolved) . Are they really unanswered? Please review your 47 unresolved questions and give credit to the people with either HELPFUL or ANSWERED as appropriate. They will appreciate it.
    Please provide you 4 digit Oracle version number.
    In 11g you could use the INSERT ALL multi-table insert to do this: http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_9014.htm
    See the above doc at 'The next examples insert into multiple tables' where you will find this excerpt:
    >
    INSERT ALL
    WHEN order_total < 1000000 THEN
    INTO small_orders
    WHEN order_total > 1000000 AND order_total < 2000000 THEN
    INTO medium_orders
    WHEN order_total > 2000000 THEN
    INTO large_orders
    SELECT order_id, order_total, sales_rep_id, customer_id
    FROM orders;
    >
    This will let you insert into both tables with one query. Your query can use an OUTER JOIN between your tables so that the key value will be NULL when a record is not found. Then your WHEN condition will check the key value and if NULL will insert into one table and if NOT NULL will insert into the other.
    Should not be a need for a staging table. Try to modify the example in the doc for your tables.

  • Main method question in java, please help

    Guys I have looked all over the internet, and cannot understand any of these questions: I would really appreciate any help on them. The first, and most important thing I would like to know is, what is static: what is a static int, or a static main method? Why is this necessary, and what does it do? Could you please provide an example? Also, why is String[] args necessary within the parameters of the main method? Is this so that it can execute it? Last thing is: objects. Where can I learn about them? I know they are made with the new operator, but don't understand their use? Could you explain why they are useful? Can you give them values? and how do they relate to the dot operator? After these are answered, I will be so happy because I will feel like I actually know a little bit. Right now, I'm just confused... Thank you so, so much in advance!

    The first, and most important thing I would like to know is, what is static'static' means that the item concerned is associated with the class itself rather than an instance: so, it is accessible to all instances.
    Could you please provide an example?
    public static void main(String[] args)is an example, but you knew that. I don't really understand the question.
    Also, why is String[] args necessary within the parameters of the main method?'args' receives the arguments you type on the command line after the class name or jar name, depending on how you invoke the application.
    This is all covered in the documentation, which you should read before asking further questions.
    Last thing is: objects. Where can I learn about them?If you don't know about objects you're not going to learn about them by asking questions on a forum. It's far too large a topic. Get yourself a book.

  • Fundamental questions in Java, please help to answer.

    I am a beginner of a Java Programming. Although I had few programming experiences on Java. But there are few conceptal questions. Hope every experts can help to explain more to me.
    1. How <b>Encapsulation</b> works in Java? Why is it needed? What benefits can be given from encapsulation? Can give some examples for me to know more?
    2. How <b>Overloading</b> works in Java? Why is it needed? What benefits can be given from it in the extensibility of programs? Can give some examples for me to know more?
    3. How <b>inheritance</b> works in Java? What benefits can be given from inheritance? Can give further explanation, such as class hierarchy for me to know more?
    4. What is <i>object class</i> and <i>object distances</i> ? What is their differences?
    5. What is <b>Reusability</b>? What benefits can it gives? Why it is needed? Can give me further examples?
    Thanks for help very much

    Maybe I'm not getting this, but you want one of us to give you a nice short answer convenient enough for you to copy down, right? Well, there aren't many people here that are willing to do that. There are many people who won't even bother answering homework questions. I don't mind, but you need to show us some work you've done, like the previous poster said. The effort has to come from you, not us. If you are learning Java, you must put some effort into it.
    How can you get an answer out of us?
    Example: I understand that inheritance is ..............., but I'm not sure about this part.............. Can anyone provide some clarification please?
    Anyway, this question has been crossposted on at least 5 forums already, which I'm sure is one of the reasons people aren't bothering with this question. Please DO NOT CROSSPOST, it's considered poor forum etiquette.
    Please don't take anything that I said negatively, but you have to understand that we are taking our time to respond to your queries, and asking us to provide short answers without doing any work on your part, and crossposting is not going to get you answers out of us.
    Cheers

Maybe you are looking for

  • CUCM 8.6.2 -- DRS: TAR File Not Created

    Hey, I am having trouble running my CUCM backups.  The Unity backups, however, are running fine.  I get completely through the Publisher, but I fail everytime on the TFTP backup on the first Subscriber node.  I am using freeFTPd as a service on a Win

  • When opening a new window, any clicks within the new window click through to the original window so you can't scroll or save from the new window.

    Anytime that a new window is opened (such as when sending an email message or opening a pdf) I am unable to click on the new window. I can't click send or click on the scroll bars of the new window. If I attempt to click on the window it clicks on wh

  • Creating wap screens

    Has any one developed screens for mobile apps on apex? is there any apex related library or tools that help with mobile screens? or do you just build lots htp.p calls to blend them in?

  • What is this Effect?? And How to get it in AE

    Hi Everyone. I am interested about the red, blue lines going around in this video clip. I have seen this effect in many ways, in many different shots, clips, commercials, etc.. I am interested how do they call it, or where can I find tutorials regard

  • Addl import duty problem

    Hi Friends, I have a situation.. i have a proforma invoice for a consumable material... the details are as follows basic=== 264000.00 excise &cess ==== 25300.00 Addl import duty ==== 7370.00 VAT on 296670===== 11866.30 sum==== 308536.80 but here the