HELP for Compile java programe !

Hello All,
i want to make java programe by which i can compile java programes
and when i compile java programe from my programe then
i shoul get compiled status means programe compile successfuly
or not compile.
if any example i m thanksfull.
onlyforjava.

how about if compile fail?
the process obj seems return value 0 as it run successful.
I haven't try this, but I have experienced the process obj returns 0 if the executed command has some routine to handle error cases, in which, error will not halt the system.
So, I recommand the following scenario.
1. let say, if your java is test.java. check the existence of file test.class.
If, it exists, get its modified time.
2. compile the java code with
Procress p = Runtime.exec(new String[]{"javac", "test.java"});
3. get the error string if any.
InputStream in = new BufferedInputStream(p.getInputStream());int read;while ((read = in.read()) != -1){  System.out.println((char)read);}
4. handle error with the exitValue
if (p.exitValue() != 0){  System.out.println("warning.");}
5. check again the file test.class if it is a newly created file.
6. if it is newly created, compile success. Else, failed.

Similar Messages

  • Need help for writing extract program

    hi
    i need help for writing extract program to retriew data from legacy system.
    i already developed bdc programs for me31k and me21.
    my requirement is to write extract program s for those t.codes.
    to retriew data from legacy system and stored in flat file.

    i need help with a java program. it is a program that allows the user to enter a student's GPA, number of extracurricular activities, and number of service activities. The user can not enter a gpa above 4.0 or below 0. The user can not enter a negative number for the number of both activities. If the student meets the following criteria: 1) GPA of 3.8 or above and at least one extracurricular activity and one service activity, 2) GPA below 3.8 but at least 3.4 and a total of at least three extracurricular and service activities, 3) GPA below 3.4 but at least 3.0 and at least two extracurricular activities and three service activities, the message "Scholarship candidate" should display. If the student does not meet the criteria above, then the message"not a candidate" should display. Can you help me, please?
    You haven't posted ANY 'java program' for us to help with.
    The forum is NOT a coding service. It is to help you with YOUR code.
    Post the code you have written and SHOW us (don't just tell us) how you compile it and execute it and the results you get. Then we can help you with any problems you are are having.
    If you need help understanding just what the program should be doing you need to ask your instructor to clarify the assignment.

  • Compiling Java Program thro EXEC

    hi..
    I want to compile java programs programatically. I am using exec for that. The problem is there is a error in the i am no getting any message from that Process .will u help me how to solve this
    URGENT
    pyari
    Code Snippet
              try
                                  String command = "cmd /c javac -classpath c:\\j2ee\\home\\ejb.jar -d "+
                                  "c:\\javapr~1\\WeblogicEJBComplier\\tempBuild "+
                                  "C:\\j2ee\\home\\demo\\ejb\\cart\\CartClient.java";
         System.out.println(command);
         Runtime rnt = Runtime.getRuntime();
                                  Process prs = rnt.exec(command);
                                  BufferedReader bfr = new BufferedReader(new InputStreamReader(prs.getInputStream()));
                                  String str = bfr.readLine();
                                  System.out.println(str);
                                  while(str!=null)
                                       System.out.println(str) ;
                                       str = bfr.readLine();
              }catch(Exception eo)
                   System.err.println(eo);

    javac writes the errors in stderr, not in stdout.
    So replace getInputStream() with getErrorStream()...

  • How to compile java programs in j2EE 1.4 SDK

    hi,
    i HAVE JUST INSTALLED NEW J2EE 1.4 SDK , IT HAS BEED INSTALLED SUCCESFULLY BUT I AM UNABLE TO COMPILE JAVA PROGRAMS WHICH I USED TO RUN IN SDK 1.4 ,OR EVEN NEW WRITTEN EXAMPLES. CAN ANYONE PLZ HELP ME.

    J2EE by itself is not capable of compiling Java. It requires that a J2SDK be installed first - this is what compiles and runs Java programs. Did you install the combination J2SDK and J2EE, or just the J2EE?
    If both are installed, then you should be able to compile and run as you used to..

  • How can i create a test suite in oracle for a java program

    hi
    i have to create a table for test cases for a java program
    in that my main concentration is on branch statements
    i have problems to choose which fields should be there in my table
    plz let me know if you have nay ideas
    thnx
    regards
    [email protected]

    no idea based on the little or nothing you've posted.
    %

  • Process name representation in a LINUX machine for a JAVA program running..

    Hi,
    We are using an Intel machine loaded with Red Hat Linux 7.2 OS to run JAVA programs. We have a requirement to calculate the CPU and MEMORY usage for each JAVA program running. Unfortunately when a java program is run say "java ESR" and we run a ps -ef | grep -i java, it is shown as hkumar 2847 2799 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2874 2847 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2875 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2876 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2877 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2878 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2879 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2880 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2881 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2882 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2883 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2884 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2885 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    instead of the actual name of the program ie. ESR.
    Does anybody know why this happens? Is there a way out to ensure that "ps -ef | grep java" gives the actual name of the java program being RUN?
    Thanks in advance,
    Harish

    You have less chance to identify which programm that VM instance is running right now.
    But you could (as we do) keep track of your programs if you save the process-id when you start the program.
    We need this to shut down running java batch programs but you could find out the used system resources with this way as well...

  • How to compile java programs? There is no javac for me!

    Hi, I'm starting to learn java and downloaded the java 1.4.0.1 standard edition from this website. However, after I installed the program, there is no javac to be found while there is a java.exe. I need javac to compile my program before I can interpret it but it is nowhere to be found!
    Did I download the wrong SDK version? I thank anyone in advance who can help me in the right direction!

    You must have the SDK to create programs. The Jre is a component of the SDK that can be downloaded separately if you only want to run programs.
    SDK downloads from here, use the row "Windows (all languages, including English)" and be sure to select the SDK COLUMN, not the JRE:
    http://java.sun.com/j2se/1.4/download.html

  • Code to compile java program

    hello,
    i am studying msc(information systems) 2 years course.
    this is my first semister.i am doing prof\ject in java.
    TITLE:Designing editor for java in java.
    I want to know how to compile a program written in the editor.i will feel very much happy,if u could tell me the suggestion.And alse running the class file.
    thanking you...

    Hi rajesh!
    First you need a java development kit (jdk).
    If you didn't get it yet you can download the actual version on this page (just search for "download").
    If you've installed the jdk make sure that the path where you installed your jdk is set to your systems path value (windows)
    you can put it in by editing your autoexec bat or by giving the following order to your dos box:
    1.) PATH (returns the actual path settings)
    2.) SET PATH old values, [...]\jdk\bin
    After having done this you should reboot your system.
    Now you can change the directory to your programs path and call:
    JAVAC yourfile.java
    this compiles your program
    JAVA yourfile
    (without any file extension!!) runs your program
    It might be useful to download the API Documentation, where the jdk tools are all descripted!!
    hope it helps,
    Thof

  • Exception when running a compiled java program in DOS

    I'm new to programming in general and java in specific. I am using the jGrasp programming software, and successfully compile my program, but when I try to run it out of DOS (which I undesrtand is the purpose of java to begin with, unless I'm mistaken), I get an exception that looks exactly like this.....
    Exception in thread "main" java.lang.NoClassDefFoundError: keyboard/java
    Caused by: java.lang.ClassNotFoundException: keyboard.java
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    I realize I may just be missing something simple, as I've not been in the class for very long, but the book doesn't seem to have the answer. It is "Starting out with Java: Early Objects, Third Edition, by Tony Gaddis. Any help will be apprecieated. The program is below, it's really short.
    The program is a simple one to teach myself scanner input and an 'if' statement:
    *     basic input program
    import java.util.Scanner;
    public class keyboard
         public static void main(String[] args)
              String Class;
              int age;
              String race;
              char sex;
              String gender;
              Scanner keyboard = new Scanner(System.in);
              System.out.print("What class do you wish to be? ");
              Class = keyboard.nextLine();
              System.out.print("How old is your character? ");
              age = keyboard.nextInt();
              keyboard.nextLine();
              System.out.print("What sex is your character? M/F? ");
              gender = keyboard.nextLine();
              sex = gender.charAt(0);
              System.out.print("What race is your character? ");
              race = keyboard.nextLine();
              if (sex == 'M')
                   System.out.println("Today you will be playing a " + race + " " + Class +
                                                           " who is " + age + " years old at the start " +
                                                           "of his adventuring career!");
              if (sex == 'F')
                   System.out.println("Today you will be playing a " + race + " " + Class +
                                                           " who is " + age + " years old at the start " +
                                                           "of her adventuring career!");                                   
    }

    Childofheinlein wrote:
    I'm new to programming in general and java in specific. I am using the jGrasp programming software, and successfully compile my program, but when I try to run it out of DOS (which I undesrtand is the purpose of java to begin with, unless I'm mistaken), I get an exception that looks exactly like this.....
    So summerizing some of what was said before and some of that wasn't.
    jGrasp is a simplistic IDE. When you pop a dos window from it it sets up the windows correctly to run your program. When you open a regular command window you must do the same yourself.
    >
    Exception in thread "main" java.lang.NoClassDefFoundError: keyboard/javaJava runs "classes". The command that you typed above meant that you were trying to run a "file". Specifically the file "keyboard.java". The two are not the same. There is however a relationship. When the source code, in this case inside of "keyboard.java" is compiled it produces a file called "keyboard.class". Insided of the file there is a "class" called "keyboard". Notice that the name of the class does not have either .java nor .class on the end of it.
    The VM (the 'java' command) finds a "class" using the class path to search files of various types for the class (again keep in mind that files contain classes but they are not themselves classes.)
    You can add to the classpath using the Sun VM using either command line options or environment variables. As noted in some of the previous messages those are "-cp" and "CLASSPATH". It is important to note that that does NOT fully specify the class path. But for your purposes it is sufficient to think of it as doing so.
    The 'default' setting for the part of the class path that you normally set (like via '-cp') is the current directory which is specified by the ".". So normally the following are equivalent.
    java -cp . keyboard
    java keyboard
    The reason the VM could not find your class when you opened the dos window yourself is because you were in the wrong directory. If you had been in the directory with the file "keyboard.class" then it would have worked (if you have not messed with the environment variable "CLASSPATH".)
    So if your class file has the following location: c:\myapps\java\keyboard.class then you can do the following.
    1. Open a console window
    2. Type "cd c:\myapps\java"
    3. Type "java keyboard"
    If the above does not work then you are in the wrong directory or the env variable CLASSPATH has been set to something.

  • Problem compiling java programs

    when i run javc in command prompt it runs fine but when i try to compile any program through command prompt it gives following error:
    javac: file not found
    usage: java <options> <source file>
    use -help for list of attributes
    what shouls i do plz help

    yogiis wrote:
    when i run javc in command prompt it runs fine but when i try to compile any program through command prompt it gives following error:
    javac: file not found
    usage: java <options> <source file>
    use -help for list of attributes
    what shouls i do plz helpuse set path="path of java/jdk/bin folder with double quotes" then press enter
    otherwise if you are ussing windows system goto to my computer properties and use advanced tab then use environment variables, there use user/system variables and check is there any exisiting path named variable is there or not if there click on edit and use ; and paste the complete path there. press ok, apply. Then use the command.

  • Help for a java Newbie please!

    Hey guys I'm writing this program for my Java 1 class I can't seem to get it complie. This is the first time we've worked with building out own classes. And I have a feeling that I'm doing something small and silly. If someone could just take a look at it I'd be more than happy.
    This is the Class we had to write it has 4 different fields of "employee information" This one looks fine.
    public class Employee
       private String name;           
       private int idNumber;      
       private String department;
       private String position;
       public Employee(String theName, int theIdNumber, String theDepartment,
                        String thePosition)
             name = theName;
             idNumber = theIdNumber;
             department = theDepartment;
             position = thePosition;
       public void setName( String theName )
             name = theName;
       public void setIdNumber( int theIdNumber )
                idNumber = theIdNumber;
       public void setDepartment( String theDepartment )
                department = theDepartment;
       public void setPosition( String thePosition )
                position = thePosition;
       public String getName()
                return name;
      public int getIdNumber()
                return idNumber;
      public String getDepartment()
                  return department;
      public String getPosition()
                 return position;
    } I think this one is good, it compiles just fine.
    Now we had to write a program that accesses the class and store "employee information" for 3 different employees and recall it. It only recalls for one right now, it doesn't compile though... sad day. Any help would be AMAZING THANKS in advanced.
    import javax.swing.JOptionPane;
    public class EmployeeInfo
       public static void main(String[] args)
           String firstEmployeeName = "Susan Meyers";
           String secondEmployeeName = "Mark Jones" ;
           String thridEmployeeName = "Joy Rogers";
           int firstEmployeeId = 47899;
           int secondEmployeeId = 39119;
           int thirdEmployeeId = 81774;
           String firstEmployeeDepartment = "Accounting";
           String secondEmployeeDepartment = "IT";
           String thirdEmployeeDepartment = "Manufacturing";
           String firstEmployeePosition = "Vice President";
           String secondEmployeePosition = "Programmer";
           String thirdEmployeePosition = "Engineer";
           Employee Employee1 = new Employee();
           Employee1.setName(firstEmployeeName);
           Employee1.setIdNumber(firstEmployeeId);
           Employee1.setDepartment(firstEmployeeDepartment);
           Employee1.setPosition(firstEmployeePosition);
           Employee Employee2 = new Employee();
           Employee2.setName(secondEmployeeName);
           Employee2.setIdNumber(secondEmployeeId);
           Employee2.setDepartment(secondEmployeeDepartment);
           Employee2.setPosition(secondEmployeePosition);
           Employee Employee3 = new Employee();
           Employee3.setName(thirdEmployeeName);
           Employee3.setIdNumber(thirdEmployeeId);
           Employee3.setDepartment(thirdEmployeeDepartment);
           Employee3.setPosition(thirdEmployeePosition);
           JOptionPane.showMessageDialog(null, "Name          ID Number   " +
                                         "Department      Position     /n" +
                                         Employee1.getName() + "   " +
                                         Employee1.getIdNumber() + "   " +
                                         Employee1.getDepartment() + "      /n");
      System.exit(0);
    }

    Also the compiling error I get is
    O:\HomeWork\CIS 260\Assignment 5\EmployeeInfo.java:28: cannot find symbol
    symbol  : constructor Employee()
    location: class Employee
           Employee Employee1 = new Employee();
                                   ^
    O:\HomeWork\CIS 260\Assignment 5\EmployeeInfo.java:39: cannot find symbol
    symbol  : constructor Employee()
    location: class Employee
           Employee Employee2 = new Employee();
                                   ^
    O:\HomeWork\CIS 260\Assignment 5\EmployeeInfo.java:50: cannot find symbol
    symbol  : constructor Employee()
    location: class Employee
           Employee Employee3 = new Employee();
                                   ^
    O:\HomeWork\CIS 260\Assignment 5\EmployeeInfo.java:52: cannot find symbol
    symbol  : variable thirdEmployeeName
    location: class EmployeeInfo
           Employee3.setName(thirdEmployeeName);
                                ^
    4 errors

  • Help for my dumb program

    Dear Sir/Madam:
    I am a lazy one.....So I post my dumb program here and hope .....
    public class AssertionExp {
    public static void main(String[] args){
    final double height = 22.5;
    final double weight = 11.0;
    assert(height < 0): AssertionExp.ErrorMessage(height,weight); //<== this line gets problem!!!
    System.out.println("The program ends....");
    public void ErrorMessage(double he, double we){
    double weight = we;
    double height = he;
    System.out.println("weight = " + weight + ", height =" + height);
    }

    Dear Sir/Madam:
    I just learn Java no more than three months....
    so.....
    the netbeans compiler shows that....
    Compiling 1 source file to C:\.....\build\classes
    C:\.....\src\AssertionExp.java:11: non-static method ErrorMessage(double,double) cannot be referenced from a static context
    assert(height < 0): AssertionExp.ErrorMessage(height,weight);
    C:\......\src\AssertionExp.java:11: 'void' type not allowed here
    assert(height < 0): AssertionExp.ErrorMessage(height,weight);
    2 errors
    I have no idea ablout the problem....
    Please help for the trouble shooting.....
    Thank you so much...

  • Cannot compile java Programs

    hi everyone,
    when i tried to compile a java Program i had created.I got the following Error.
    Error occoured during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object
    I reinstalled the entire thing from the system and when i tried to compile the java Program again it gives like a 1000 errors even on the programs i know that work fine and even the very basic 5 or 10 line Programs.Can someone tell me what is happening??

    Having Deleted a file in the folder that i was executing the javac seem to have fixed the problem.It was called String.java
    and the content of the file were as mentioned under:Any help on why it happened or what the file was doing would be really appreciated.
    The content of the file:-
    ""Java String Examples
    The String class implements immutable character strings, which are read-only once the string object has been created and initialized. All string literals in Java programs, are implemented as instances of String class.
    The easiest way to create a Java String object is using a string literal:
    1.
    String str1 = "I can't be changed once created!";
    A Java string literal is a reference to a String object. Since a String literal is a reference, it can be manipulated like any other String reference. i.e. it can be used to invoke methods of String class.
    For example,
    1.
    int myLenght = "Hello world".length();
    The Java language provides special support for the string concatenation operator (+), which has been overloaded for Java Strings objects. String concatenation is implemented through the StringBuffer class and its append method.
    For example,
    1.
    String finalString = "Hello" + "World";
    Would be executed as
    1.
    String finalString = new StringBuffer().append("Hello").append("World").toString();
    The Java compiler optimizes handling of string literals. Only one String object is shared by all strings having same character sequence. Such strings are said to be interned, meaning that they share a unique String object. The Java String class maintains a private pool where such strings are interned.
    For example,
    1.
    String str1="Hello";
    2.
    String str2="Hello";
    3.
    If(str1 == str2)
    4.
    System.out.println("Equal");
    Would print Equal when executed.
    Since the Java String objects are immutable, any operation performed on one String reference will never have any effect on other references denoting the same object.
    String Constructors
    String class provides various types of constructors to create String objects. Some of them are,
    String()
    Creates a new String object whose content is empty i.e. "".
    String(String s)
    Creates a new String object whose content is same as the String object passed as an argument.
    Note: Invoking String constructor creates a new string object, means it does not intern the String. Interned String object reference can be obtained by using intern() method of the String class.
    String also provides constructors that take byte and char array as an argument and returns String object.
    String equality - Compare Java String
    String class overrides the equals() method of the Object class. It compares the content of the two string object and returns the boolean value accordingly.
    For example,
    1.
    String str1="Hello";
    2.
    String str2="Hello";
    3.
    String str3=new String("Hello") //Using constructor.
    4.
    5.
    If(str1 == str2)
    6.
    System.out.println("Equal 1");
    7.
    Else
    8.
    System.out.println("Not Equal 1");
    9.
    10.
    If(str1 == str3)
    11.
    System.out.println("Equal 2");
    12.
    Else
    13.
    System.out.println("I am constructed using constructor, hence not interned");
    14.
    15.
    If( str1.equals(str3) )
    16.
    System.out.println("Equal 3");
    17.
    Else
    18.
    System.out.println("Not Equal 3");
    The output would be,
    Equal 1
    Not Equal 2
    Equal 3
    Note that == compares the references not the actual contents of the String object; Where as equals method compares actual contents of two String objects.
    String class also provides another method equalsIgnoreCase() which ignores the case of contents while comparing.
    Apart from these methods String class also provides compareTo methods.
    int compareTo(String str2)
    This method compares two Strings and returns an int value. It returns
    - value 0, if this string is equal to the string argument
    - a value less than 0, if this string is less than the string argument
    - a value greater than 0, if this string is greater than the string argument
    int compareTo(Object object)
    This method behaves exactly like the first method if the argument object is actually a String object; otherwise, it throws a ClassCastException."""
    Edited by: Gold_y on Oct 30, 2009 4:59 AM

  • Need Help with a JAVA programming assignment

    How do I write a JAVA program that could be used as the start of an MS-DOS/Windows simulation of the IEEE 802.3 protocol? I am to only code the parts necessary to build the 802.3 frame. For the initial implementation, the Checksum function need not be a CRC function, and the Destination and Source addresses wil be in input, stored, and output, and in dotted-decimal format.
    I need:
    1. A record to describe the frame, with each field being a (byte-) string of the required size, except that the Data field is of variable size. Although the "Source address" and "Destination address" would be 6 bytes for a real implementation, for this first implementation you can either assume they'll be text strings in the usual "dotted decimal" form (e.g. "14.04.05.18.01.25" as a typical example--from Tanenbaum, p. 429), or 6 hex digits.
    2. Suitable constant declarations for values such as the standard "Preamble" and "Start of Frame" values.
    3. Suitable functions to Get the three variable values "Destination address", "Source address", and "Data" from the standard input device.
    4. A suitable function to display each of the fields of a given frame in a format such as:
    Preamble: ...
    StartofFrame: ...
    Destination: ...
    etc.
    5. A suitable function to generate a "Pad" field if necessary.
    6. A "dummy" Checksum-generating function which just takes the first 32 bits (4 bytes) of the Data (or Data+Pad, if necessary) rather than an actual CRC algorithm.
    I have no experience with Java. Can you help me or start me in the right direction?
    Thanks...........TK

    If you have no experience with Java, then it seems to me your first step should be to start learning the language. But it's difficult to advise how, since we don't know anything about your background. There are many good books available on Java, some are for beginners and some are for advanced programmers, so I'd suggest you go somewhere that has a large selection and start looking for something that doesn't seem completely over your head.

  • Need Help with a Java program

    Hey
    I am doing a bachelor of Multimedia and for some reason I was forced to do Programming 1 which is just Java programing.I have been doing pretty well but we have the final exam coming up on Thursday and they told us to learn how to do this question but I have no idea how to do it, could someone please help me?
    Write a program that reads a file containing a list of students' student numbers and names, and then writes out another file in which the students have been formed into project groups.
    Sample input file:
    96439530 Naranek, Kosh
    08532109 Ivanova, Susan
    87642078 Sheridan, John
    44327889 Varner, Dell
    98100023 Kotto, Vir
    66345689 Sinclair, Jeffrey
    77421009 Garibaldi, Michael
    88775544 Winters, Talia
    54321098 Alexander, Lyta
    12345098 Mollari, Londo
    03465499 Takashima, Laurel
    88765432 Kyle, Benjamin
    08876500 Keffer, Warren
    07687878 Cole, Marcus
    For the project course: no group should have more than 5 members; and it is desireable that all groups have as close to 5 members as possible; and that students be allocated to groups alphabetically by family name, as in this sample output file:
    Group 1:
    Lyta Alexander (54321098)
    Susan Ivanova (08532109)
    Benjamin Kyle (88765432)
    John Sheridan (87642078)
    Dell Varner (44327889)
    Group 2:
    Marcus Cole (07687878)
    Warren Keffer (08876500)
    Londo Mollari (12345098)
    Jeffrey Sinclair (66345689)
    Talia Winters (88775544)
    Group 3:
    Michael Garibaldi (77421009)
    Vir Kotto (98100023)
    Kosh Naranek (96439530)
    Laurel Takashima (03465499)
    Students' names are first sorted (Alexander, Cole, Garibaldi, Ivanova, ...), then allocated to the tutes in rotation (Alexander to 1, Cole to 2, Garibaldi to 3, Ivanova to 1, ...).
    Note also that the student's details are written in a different format from the input. You may make the (usually wrong!) assumption that each student has a simple one-word family name and one other name.

    I'm sorry too annoy you again but I don't know how to implement what you told me. Here is my current code:
    import java.io.*;
    import java.util.*;
    class DetailSortTest {
         public void run() {
              try {
                   BufferedReader in = new
                   BufferedReader(new FileReader ("Data.txt"));
                   String line = in.readLine();
                   String[] names = new String [10];
                   int i = 0;
                   PrintWriter FileOut = new
                   PrintWriter(new FileWriter ("Data 2.txt"));
                   processFilesTest(in, FileOut);
                   in.close();
                   FileOut.close();
              } catch (FileNotFoundException f) {
                   System.out.println("Could Not Open The File");
              } catch (IOException i){
                   System.out.println(i.getMessage());
         public void processFilesTest (BufferedReader in, PrintWriter FileOut)
         throws IOException {
              String data[] = new String[100];
              List dList = new ArrayList();
              String NLine = in.readLine();
              FileOut.println(NLine);
         public static void main(String[] args) {
              DetailSortTest anObject = new
              DetailSortTest();
              anObject.run();
    How would I do it I tried:
    NLine.split(data[2]+""+data[1]+""+data[0]);
    But all that displays is null, null, null
    I know I am probably so stupid but I really appreciate the help

Maybe you are looking for

  • How to improve performance using bulk collects with plsql tables or arrays

    Hi All, my procedure is like this declare cursor c1 is select ---------------------- begin assigning to variables validations on that variables --50 validations are here -- insert into a table end; we have created indexes on primary keys, i want to u

  • How to assign a URL in the Tabular Form

    Hi, I am using the htmldb.item api's to create manually,the Tabular form. I have got a column in the database(View) like ''||substr(DESCRIPTION,1,30)||decode(substr(DESCRIPTION,30,1),null,null,'...')||'' DESCRIPTION, which displays as a URL and when

  • "Notepad" is Not Listed as a Choice for a ShortCut on Alias 2 (Samsung Sch u750)

    Can't SetUp a ShortCut for "NotePad" on Alias 2 (Samsung  Sch u750). When I select "Settings & Tools" then  6.Phone Settings, 2.Set ShortCuts,  Then I discover that "NotePad" is not among the 44 menu choices - there's a gap in the list after "New Vid

  • How to lock bottom control bar from auto-hiding in full screen mode

    I am using Flash Player with ie in Win7. It is very irritating while watching YouTube videos for the status/control lbar to keep auto-hiding. When the bar auto-hides, the pause/play position becomes the progress bar position - and a click where Pause

  • RMAN - Adding new Tablespaces

    After having run rman for 2 months, new tablespaces have been added today. I ran a full backup with rman, but the new tablespaces do not show with: list backup; Also RESTORE DATABASE VALIDATE; returns no errors. How can I ensure, the backup is up to