Search:

Type: Posts; User: Java Neil

Search: Search took 0.11 seconds.

  1. Replies
    17
    Views
    2,998

    Re: New to Objects...

    Check me...

    I have two codes that both work. One code based off of the example in my book, and the example you gave me.

    Book example:
    import javax.swing.JOptionPane;
    public class...
  2. Replies
    17
    Views
    2,998

    Re: New to Objects...

    Now see...That was very helpful! Thanks for setting up the form.

    I'll get it. I just started objects. No need to doom me before I apply the concepts.
  3. Replies
    17
    Views
    2,998

    Re: New to Objects...

    OK, I don't understand. As I said I work better with "seeing the logic" rather than being told. Never built an object . No nothing of how constructors work. You're naming parts of an object that I...
  4. Replies
    17
    Views
    2,998

    Re: New to Objects...

    Like I said before. My teacher has only covered about 30 minutes worth of material for the last part of the last class. I have not grasped the material fully yet.

    I applied you code suggestion...
  5. Replies
    17
    Views
    2,998

    Re: New to Objects...

    OK, I changed the variables to just public.

    import javax.swing.*;

    public class TestRectangle {

    public static void main (String[] args) {

    Rectangle rectangle1...
  6. Replies
    17
    Views
    2,998

    Re: New to Objects...

    Well after about 3 hours, I need some help with something I haven't learned yet.

    Here is my first attempt at this program. My main goal was just to have it compile and show me the fields.

    ...
  7. Replies
    17
    Views
    2,998

    Re: New to Objects...

    For my hardest assignment in this chapter I am supposed to create a "class Rectangle" to represent a rectangle. The class needs to have the following...

    1. Two double data fields named width and...
  8. Replies
    17
    Views
    2,998

    Re: New to Objects...

    They are just strings for input.

    Here is the corrected code

    class code
    public class Employee {
    private String fname;
    private String lname;
    private String id;
    private...
  9. Replies
    17
    Views
    2,998

    Re: New to Objects...

    OK, I see what you mean.

    I feel kinda dumb.
  10. Replies
    17
    Views
    2,998

    Re: New to Objects...

    Ah! Cool.

    Now it compiles but when I run it no values are being stored in the salary field. It just displays 0.0?

    Once I get some of these basics down I should be able to truck along.
  11. Replies
    17
    Views
    2,998

    New to Objects...

    I'm starting on a very simple program dealing with classes and objects and I'm confused about what's going on here...

    Class file

    public class Employee {
    private String fname;
    ...
Results 1 to 11 of 11