Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

HELP...... with Java Question.

Options
2»

Comments

  • Registered Users Posts: 2,021 ✭✭✭ChRoMe


    TrueDub wrote: »



    Excellent, but not free...

    The community edition is free.


  • Moderators, Technology & Internet Moderators Posts: 1,334 Mod ✭✭✭✭croo


    TrueDub wrote: »
    Excellent, but not free...
    There is a free (& open source) community edition. I don't know how the commercial edition compares - often support is the only difference. The fact that it's not java specific is probably Eclipse's strongest asset. I do use Eclipse mostly because I have a long history with it but I found netbeans okay too - now that oracle own it I'm not sure if it has any future.

    I do hear lots of good things re IntelliJ from people who specialize in java so have tried a few times - but I'm just used to eclipse.

    After saying all that, I'm not sure that an IDE is a good place for a beginner to start. They may end up spending a lot of time learning the IDE application instead of learning to code. Something simple like jedit (written in java) might be more appropriate. Though notepad++ seems to be much more popular but I really like the split screen functionality in jEdit... and of course th fact it's written in java means I can use it on windows/linux or mac.


  • Registered Users Posts: 2,021 ✭✭✭ChRoMe


    croo wrote: »

    I do hear lots of good things re IntelliJ from people who specialize in java so have tried a few times - but I'm just used to eclipse.

    Spend a day or two getting used to it and you will wonder how the **** you ever used Eclipse in the first place.

    I think I've converted about 10-15 developers over the years to it, I've also imposed it on all of my team members. Who have all thanked me for insisting on it once they were used to it.


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,089 Mod ✭✭✭✭Tar.Aldarion




  • Moderators, Society & Culture Moderators Posts: 12,521 Mod ✭✭✭✭Amirani



    Plus one here.


  • Advertisement
  • Registered Users Posts: 710 ✭✭✭mad turnip


    Eclipse is used everywhere though, its a great development tool for C++ and to top it all off its free and employers can avoid paying even more people money. For the sheer fact that its so widely used I would use eclipse although I tried using IntelliJ for a few days and my god, I wanted to rip my hair out it just ****s about doing things I do not want it to do would never consider going back to use it again!


  • Moderators, Sports Moderators, Regional Abroad Moderators Posts: 2,639 Mod ✭✭✭✭TrueDub


    I didn't see the community option for IntelliJ - makes it more attractive then.

    I'm an Eclipse user, haven't had a need to move for a while so not really worried about the other options.

    However, my opinion on all of them is this: they're tools. Screwdrivers, if you will. Having a favourite is fine, most people do, but the holy wars fought over these things leave me bemused.


  • Registered Users Posts: 760 ✭✭✭mach1982


    OP , did you try and Google, the is tons information on java

    http://www.learnjavaonline.org/

    also this a very good book http://www.amazon.com/dp/0071420401


  • Registered Users Posts: 2,021 ✭✭✭ChRoMe


    TrueDub wrote: »
    However, my opinion on all of them is this: they're tools. Screwdrivers, if you will. Having a favourite is fine, most people do, but the holy wars fought over these things leave me bemused.

    I like that my hammer has extra features that make it much harder to hit my thumb.....


  • Registered Users Posts: 800 ✭✭✭a fat guy


    ChRoMe wrote: »
    I like that my hammer has extra features that make it much harder to hit my thumb.....

    Oh yeah? Well my hammer can accidentally delete projects that are due the next day!

    Beat that!

    On a side-note, Eclipse actually did that to me once when I CTRL + Z'd a project I had just copied. Deleted the original too, and I was absolutely livid. It's apparently a known bug.


  • Advertisement
  • Registered Users Posts: 10,506 ✭✭✭✭28064212


    ChRoMe wrote: »
    I like that my hammer has extra features that make it much harder to hit my thumb.....
    But what if I want to hit my thumb?


    :)

    Boardsie Enhancement Suite - a browser extension to make using Boards on desktop a better experience (includes full-width display, keyboard shortcuts, dark mode, and more). Now available through your browser's extension store.

    Firefox: https://addons.mozilla.org/addon/boardsie-enhancement-suite/

    Chrome/Edge/Opera: https://chromewebstore.google.com/detail/boardsie-enhancement-suit/bbgnmnfagihoohjkofdnofcfmkpdmmce



  • Registered Users Posts: 79 ✭✭leinad


    28064212 wrote: »
    But what if I want to hit my thumb?


    :)

    Used Eclipse for 6 years then intelliJ for 6 months and have to say if you know what you are doing intelliJ is a far superior faster less buggy and more helpful IDE


  • Registered Users Posts: 72 ✭✭shanard


    Ok folks - In particular MT - i have finished my code for my assignment and all works grand apart from when the user say inputs any other number that is not on the menu - i want it to say "Please enter numbers 1,2 or 3" - which i have, but when they press a key it comes out of the program?????

    Another thing i was wondering if anyone knows if it is possible and if so how do i do it - it is the assignment specifically says that the ID should be 6 digits - so if the user selects option 1 to enter Employee details and enters say less than or more than 6 digits - can i get something to say - "Invalid - Please enter 6 digit IDs only!!".....

    Thanks folks - assignment has to be in by close of business today...

    [code]
    import java.util.Scanner;
    import java.io.*;

    public class EmployeeManagementSystem{
    public static void main(String[] args){

    Employee emp = new Employee();

    String s;

    //use the Scanners
    Scanner scan = new Scanner(System.in);
    Scanner scan2 = new Scanner(System.in); // used 2nd Scanner as was not reading in data as per below

    // menu options for user
    System.out.println("**************************************");
    System.out.println("| What would you like to do? |");
    System.out.println("| 1) Enter a new employees details |");
    System.out.println("| 2) Search for an employee |");
    System.out.println("| 3) Exit |");
    System.out.println("**************************************");

    int i = scan.nextInt();

    if(i >=4){
    System.out.println("Invalid Option, Please enter numbers 1, 2 or 3.");

    }else if(i == 1){

    try{ // use BufferedWriter to write the users details on file called "Employees.txt"
    BufferedWriter bw = new BufferedWriter(new FileWriter("Employees.txt", true));

    System.out.println("Please enter an Employee ID Number");
    int ID = scan.nextInt(); //this line of code reads in the users input
    emp.setID(ID); // this sets the ID Number

    System.out.println("Please enter an Employee Name");
    String name = scan2.nextLine();
    emp.setName(name); // this sets the Name

    System.out.println("Please enter an Employee Address");
    String address = scan2.nextLine();
    emp.setAddress(address);

    System.out.println("Please enter an Employee start date");
    String date = scan2.nextLine();
    emp.setDate(date);

    bw.write(ID+" "+name+" "+address+" "+date+System.getProperty("line.separator"));

    // this is to call the flush method
    bw.flush();

    // to close the BufferedWriter
    bw.close();
    }
    catch(IOException e){
    System.out.println(e);
    }

    }else if(i == 2){
    //}while(!(Integer.toString(searchID).length()==6)){ // this is used to verify user types in 6 digit ID no. only...

    try {
    System.out.println("Please enter the Employees ID Number:");

    //the employee ID the user is searching for
    int searchID = scan.nextInt();

    //use the BufferedReader now to read the written file called "Employees"
    BufferedReader br = new BufferedReader(new FileReader("Employees.txt"));

    s = br.readLine();
    String ID = Integer.toString(searchID);
    while(s != null){ // this will loop through my textfile i set up called Employees.txt

    //english - if s contains searchID, print s
    if (s.contains(ID)){
    System.out.println(s);
    }
    s = br.readLine();
    }
    br.close(); // this will close the buffered reader

    } catch (IOException e) {
    System.out.println(e);
    }
    } else if(i == 3){
    System.exit(0);
    }
    }
    }


  • Registered Users Posts: 710 ✭✭✭mad turnip


    shanard wrote: »
    Ok folks - In particular MT - i have finished my code for my assignment and all works grand apart from when the user say inputs any other number that is not on the menu - i want it to say "Please enter numbers 1,2 or 3" - which i have, but when they press a key it comes out of the program?????

    Another thing i was wondering if anyone knows if it is possible and if so how do i do it - it is the assignment specifically says that the ID should be 6 digits - so if the user selects option 1 to enter Employee details and enters say less than or more than 6 digits - can i get something to say - "Invalid - Please enter 6 digit IDs only!!".....

    Thanks folks - assignment has to be in by close of business today...


    ARGHGHGHGH MAKE THEM CODE TAGS WORK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    Another thing i was wondering if anyone knows if it is possible and if so how do i do it - it is the assignment specifically says that the ID should be 6 digits

    The easiest way to do this is to convert the integer to a string and then check the length of that string using the length() method for example if I had the word: test in a string like so:
    String s = "test";
    int stringLength = s.length();//this will be 4
    

    To convert an int to a string can be done like so:
    String intStr = "" + intName;
    
    inputs any other number that is not on the menu
    To do this you can't use the method scanner.readInt(), you need to read a string then convert this to an int. See the example below:
    String someNum = "586974";
    int thatNum = Integer.parseInt(someNum);
    

    the Integer.parseInt method will take a string as an argument and return an int, it will throw an exception if the string is not an integer or contains whitespace on either end of the string. Handling this exception is how you know if the string is an integer or not.


  • Registered Users Posts: 2,021 ✭✭✭ChRoMe


    leinad wrote: »
    Used Eclipse for 6 years then intelliJ for 6 months and have to say if you know what you are doing intelliJ is a far superior faster less buggy and more helpful IDE

    Innit, its in a completely different league!


Advertisement