JCC CSC 1590 Computing Fundamentals I

Fun For Everyone

Reading: pg 445 – 450 User defined classes and constructors




Please read and write a 3:2:1 response to the reading. Submit by April 18th.

Create a free edublog to get your own comment avatar (and more!)

16 Responses to “Reading: pg 445 – 450 User defined classes and constructors”

  1.   Captain Charisma Says:

    1. A class is a collection of a fixed number of components.
    2.A constructor has the same name as the class, and it executes automatically when an object of that class is created.
    3. The constuctor withour parameters is called the default constructor.

    1.Are the only types of modifiers public, static, and private?
    2.What is in the protected category?

    1.Knowing this information on classes will hopefully help out with this lab.

  2.   Kull-The Conquerer Says:

    1.A constructor has the same name as the class, and it executes autmaticlly when an object of that class is created.
    2.The construtor without the parameters is called the default constructor.
    3.The methods of a class are called the instance methods of the class.

    1.What are fields?
    2.What is a package?

    1.This is a bit confusing but hopefully I understand it and can use it in my program.

  3.   Lbboy45 Says:

    1)A member of a class is declared like a variable, if it is a variable.
    2)Fields are data members of a class.
    3)The name of a consructor is the same as the name of the class.
    1)How does a program know what constructor to use if there are many?
    2)When is it important to declare things to be private?
    1)constructors and methods are used to organize and simplify programs.

  4.   nezumigraverobber Says:

    1) class is a reserved word in java and the data members of a class are alos called fields.
    2) A member of a private class cannot be accessed outside of the class. But a member of a public class may be.
    3) A constructor has the same name as the class and it executes automatically when an object of that class is created.

    1) could we still declare something as class id we capitalized the ‘C’??
    2) How would we access a member of the public class outside of the class.

    1) Just more class stuff, like everything else we’ve been doing.

  5.   Andrea Says:

    1. Class components are called members and consist of noamed constants, variable declarations and methods.
    2. instance variables are non static.
    3. Constructors consist of the same name as the class, exicute automatically when instances are created and there are two types of constructors one with and one with out parameters. the one with out becomes your defalt.
    1. if your program consits of two constructors with out parameters how does it decide which is the defalt?
    2. Could you have a method in a protected class that consists of more than just accessor methods.
    1. I understand the use of public and private methods but what is the importance of protected and why are they rarely used?

  6.   horselover Says:

    1if you create a constructor the java program will automatilly create a defult constructor
    2setTime is a mutator method
    3makecopy will make a copy of one object into another.

    1do we have to use gui boxes if the hours min sec?
    2should the hours min and sec always be private

    1it is kinda like the gui boxes that we have to enter the hours and min and sec in seoperate boxes

    WE SHOULD HAVE VACATIONS MORE OFTEN, IT MAKES ME HAPPY:):)

  7.   horselover Says:

    :) :):):):) HE HE HE

  8.   Jordan Says:

    1.) If you do not include any constructor in a class, then Java automatically provides the default constructor.

    2.) If you provide at least one constructor and do not include the default constructor, then Java will not automatically provide the default constructor.

    3.) If there are multiple constructors, the constructor that executes depends on the type of
    values passed to the class object when the class object is instantiated.

    1.) What are the methods of a class called?

    2.) What are mutator methods?

    1.) LBBoy it is important to declare things private when you don’t want them to be accessed from outside the class.

  9.   Courtney Says:

    1.some members of classes can be private and some can be public
    2.class is a reserved word
    3.constuctors have the same name as classes

    1. Can a class have more than one constcutor?
    2. if yes, how can they because they have the same name?

    1. Jordan- why would it matter if its private? like why would you want to hide them from other classes?

  10.   GOD Says:

    1.) If a member of a class is a named constant, variable, or method, you declare it like the corresponding thing it is named like.
    2.) IF a member of a class is private, you cant access it outside the class, if its public you can access it outside the class.
    3.) In Java, private, protected, and public are reserved words.
    1.) How many constructors can be used?
    2.) How flexible are the parameters in classes? Can they be invented?
    1.) User defined classes give us llots of freedom to utilize our knowledge. We have the freedom to also create parameters to control what our methods do.

  11.   Mrs. Furman Says:

    Courtney,

    The reason we have private data is to protect its integraty. We would not want to have a client class that is able to change our initial data. Take for example the class on Circle. The data member radius (or radious, depending on who you are) is the backbone to the definition of the circle. We do not want them to be able to change this easily, hence it is private. Does anyone know what we call it when we are trying to hide data?

    To address another issue. Protected is an access specifier as well. We use protected mostly with inheritance, it will allow extended classes the ability to access the data members, but not clients.

    Sorry I have been a little out of touch. They usually have internet access set up the first day, but they didn’t have it set up until Thursday at 11.

  12.   xjvzmrtab ebfocxv Says:

    tuclngdsm jgxbscyr mjsho smhlf jvzlno lomq afpntcrd

  13.   mjbxtzeuq qsmxd Says:

    dcelr zomnhjb hqpzkrj imlauhw fmeq gpixwvt gzdn http://www.vnpgs.dvgajcsh.com

  14.   cheap levitra Says:

    Very good site. Thank you:-)
    http://search.orange.co.uk/all?brand=ouk&tab=web&q=Inpharmacy.org buy levitra

  15.   Viagra Says:

    Good site. Thanks.
    http://all7search.com Levitra

  16.   levitra Says:

    Nice site. Thanks:-)
    http://levitrabb.zs.pl buy levitra

Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-Spam Image