Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Netbeans Java Help

  1. #1
    Junior Member
    Join Date
    Jan 2014
    Posts
    11
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Netbeans Java Help

    Hi, I am taking a class on java using netbeans, I have created this so far, but still getting an issue on this part:

    public class Employee {

    Here is my code so far:

    /*
    * To change this license header, choose License Headers in Project Properties.
    * To change this template file, choose Tools | Templates
    * and open the template in the editor.
    */

    package coursework;

    /**
    *
    * @author csm
    */
    public class Employee {
    String firstName;
    String lastName;
    int employeeId;
    double hourlyRate;

    public Employee(String firstName,String lastName,int employeeId,double hourlyRate)
    {

    }

    public void printEmpDetails()
    {
    System.out.println("Name: " + firstName + " " + lastName);
    System.out.println("Emp. Id: " + employeeId);
    System.out.println("Hourly Rate: $" + hourlyRate);
    }
    }

    public class Employee {

    public static void main(String[] args) {
    Employee emp1 = new Employee("Henry", "Cook", 2350, 23.50);
    Employee emp2= new Employee("Tyler", "Cook", 7080, 19.75);
    emp1.printEmpDetails();
    emp2.printEmpDetails();

    }






    }





  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Netbeans Java Help

    Please read this topic to learn how to post code correctly.

    What's the issue? Describe it, post the corresponding error message, ask specific questions.

  3. #3
    Member Ganeprog's Avatar
    Join Date
    Jan 2014
    Location
    Chennai,India
    Posts
    80
    My Mood
    Love
    Thanks
    3
    Thanked 6 Times in 6 Posts

    Default Re: Netbeans Java Help

    Hi,

    Why you r using same class name "Employee". Post the errors what you are getting .

    Happy to help

    thanks,

Similar Threads

  1. Replies: 7
    Last Post: January 19th, 2014, 02:17 PM
  2. [SOLVED] Write a java program to display even numbers between 2 and 200 using netbeans java
    By Shalom in forum What's Wrong With My Code?
    Replies: 0
    Last Post: December 11th, 2012, 05:16 AM
  3. java netbeans compare
    By senthil4984 in forum Java IDEs
    Replies: 2
    Last Post: November 6th, 2011, 05:39 AM
  4. Java ME / Netbeans : Device Name
    By Drakenmul in forum Java ME (Mobile Edition)
    Replies: 0
    Last Post: July 27th, 2009, 02:37 PM

Tags for this Thread