Class question for Class

I'm a dumb novice and have an assingment for school...
I have to write a program that stores, manipulates and print student info
I have to write 2 classes Student and Admisions. Student will have the fields I need and Admissions will manipulate the data.
Student must have the following fields - Name , Address, Date (as Classes) and ID (as a string variable identifing the student)
My question is if Student is supposed to be a class and also it's fields are to be classes, how do I write those classes(fields) under the class Student (are they supposed to be methods of the class student, is that what they mean?) Or do I just write other classes within the class Student ?
Can someone show me an example how Name should be written within Student ? (Name is to have fields FirstName and LastName)
Help!!!!!

My question is if Student is supposed to be a class
and also it's fields are to be classes, how do I
write those classes(fields) under the class Student
public class Student {
    private String name;
    private Date date;
    etc.
(are they supposed to be methods of the class
student, is that what they mean?)No. The fields will be objects (well references to objects, actually). You might have get/set methods to access those fields, but the fields themselves are just variables of the appropriate type.
Or do I just write
other classes within the class Student ?You don't define those classes inside Student. Student will use String, Date, and possibly other classes defined elsewhere--either in the core API, or by you. (Looks like just cor API here, but I didn't look that closely.)

Similar Messages

  • Class  Refresh for Class mapped through Relation not Query

    We have Class A which is root of Domain Object Tree for our Application.
    We have Class B. Relationship for A -> B is one to one with Use Indirection turned on.
    Back reference (B->A) is also one to one with Use Indirection turn on.
    When we try to do getB() on Class A (i.e. A.getB()). Query is fired only on first
    access call to get(). We have a query to get Class A which always refresh A
    but not B. We tried setting Caching Policy - Always refresh on Class Descriptor for
    Class B. But still the query is not fired on object B when A.getB() is called.
    I need to class to be always refresh as this can get added on deleted outside
    Toplink Application. Hence is always need to refresh the Class B.
    What should We do.

    Refreshing in TopLink is based on queries. When you are accessing getB(), you are simply resolving a Java reference. (ie A.b). If B must always be refreshed I would recommend not mapping A.b attribute. Instead getB() should always issue a refreshing query.
    --Gordon                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Some questions for class project? Trying to learn more about the iPhone

    Hey guys, I am looking for some quick feedback on the iPhone and possibly the iPad for a class assignment. If anyone could share information on the following questions that would be fantastic. Thanks!
    1. What are some of the disadvantages of Apple not providing Flash/USB for its products(iPad, iPhone, iPod Touch)?
    2. Why should customers buy an iPad (no USB) rather than the Kindle (USB ports)?
    3. Why do you think Apple doesn't provide Flash/USB ports to its products (iPad, iPhone, iPod Touch)?
    4. Would the lack of USB/Flash in Apple products affect your decisions to purchase Apple products versus a competitor's product?
    5. Do you expect that Apple will begin to incorporate technologies such as USB/Flash in the future as competitor products begin to steal market share?
    6. Apple views Flash as a dying technology. Steve jobs has even compared not supporting Flash on the iPad to Apple dropping support for floppy drives. Do you believe there is any value to this analogy and why?
    7. What do you think could be some good aspects of no USB on the iPad?
    8. What affect will the implementation of HTML5 have on the issues with iPad's lacking Flash capabilities?
    9. How did you gain an interest in Apple how would you rate that product and would it it recieve a higher rating if it provided USB/Flash?
    10. Would you be more interested in purchasing a Apple product if USB use was provided? Or would this quality not have any affect on your decision to purchase the product?

    This sounds more like a marketing survey...

  • Extra credit question for class

    hey guys my physics teacher gave me an extra credit question to answer. judging by my grade in physics...i could really use the help. Why does the mac labtop use a 2 prong charger but the extension cord is a 3 prong?

    Arent you supposed to do the homework yourself?
    you need to read about the differences:
    http://electronics.howstuffworks.com/everyday-tech/question110.htm

  • Alternative classes available for classes in weblogic9.2 server

    Hi,
    I am using weblogic.Servlet.FileServlet and weblogic.servlet.internal.weappservletContext in my application from weblogic7.0 weblogic.jar.
    After migrating to weblogic9.2 server it is found that these two classes are not there in weblogic.jar of weblogic9.2.
    is there any alternative class in weblogic.jar of weblogic9.2 server so that it is not required to use these two classes.

    FOLLOW UP:
    OK I decided to change the compiler setting to have a source and target of "1.3".
    When we try to load the java .class files we get a
    ORA-29545 badly formed class
    with no additional information.
    Should I try loading the source directly?
    thanks again
    -Mike

  • KodoHelper.getSequenceGenerator(PersistenceManager pm, Class forClass) and class hierarchies

    Hi,
    probably you guys have thought of it, but I just wanted to make sure:
    when I call getSequenceGenerator(PersistenceManager pm, Class forClass)
    for class A and class B having a common superclass C, will I get the
    same SequenceFactory on both calls? Or, in other words, are sequence
    numbers sequential for PersistenceCapable classes from the same class
    hierarchy?
    It's not mentioned in the docs, but I'm going to depend on it.
    Thanks for clarification,
    J__rg.

    Marc Prud'hommeaux wrote:
    Joerg-
    That depends on the underlying SequenceFactory you are using. If you are
    using the default sequence generator, then sequence numbers will be
    globally unique, regardless of the class you are using it for.
    For more details on the sequence generators, see:
    http://docs.solarmetric.com/manual.html#ref_guide_pc_oid_pkgen_seqfactory
    In article <c1db68$493$[email protected]>, Joerg von Frantzius wrote:
    Hi,
    probably you guys have thought of it, but I just wanted to make sure:
    when I call getSequenceGenerator(PersistenceManager pm, Class forClass)
    for class A and class B having a common superclass C, will I get the
    same SequenceFactory on both calls? Or, in other words, are sequence
    numbers sequential for PersistenceCapable classes from the same class
    hierarchy?
    It's not mentioned in the docs, but I'm going to depend on it.
    Thanks for clarification,
    J__rg.
    Alright, looks like I'd only run into problems if I configured the
    db-class (ClassDBSequenceFactory
    <http://docs.solarmetric.com/javadoc/kodo/jdbc/schema/ClassDBSequenceFactory.html>)
    SequenceFactory (which I don't).
    Thanks,
    J__rg.

  • The HttpServlet Class. A question for all please

    Hello there,
    When we write our Servlets,we extend the HttpServlet class.
    This class is an abstract class having the doGet() and doPost()
    methods which we normally override for our custom functionality.
    We cannot instantiate this class as this is abstract.
    Why couldnt this be defined as an Interface then?
    This could then have the same doGet() and doPost() methods which
    we could then implement in our class.
    Can any one explain to me this difference or am I missing anything
    here.?
    Wouldnt defining the HttpServlet class as an Interface be a viable
    solution?
    Regards
    Ajay

    "An interface cannot implement any methods, whereas an abstract class can"
    HttpServlet extends GenericServlet and has methods so it can not be an interface.

  • How to programmatically get the source for a class provided the class name?

    Hello,
    As a quick background, I am providing some tools to potential users of an in-house framework. One is the ability to generate quick prototypes from our existing demo applications. Assume a user downloads our jars and uses them in their project (we are using Eclipse, but that detail should not greatly affect my question). Included in the jars is a demos package that contains ready-to-run classes that serve to exhibit certain functionality. Since many users may just need quick extensions of these demos, I am trying to provide a way for them to be able to create a new project that starts with a copy of the demo class.
    So, the user is provided a list of the existing demos (each one uses a single class). When the user makes their selection, with the knowledge of our framework, I can translate that into what demo class they need (returned as a string of format package.subpack1.subpackn.DemoClassName). What I now want to do is to use that complete class name to get the source (look up the file) for the corresponding class, and copy it into to a new file in their project (the copying into the project can be done easily in Eclipse, so what I need help with is the bolded part). Is there a simple way to get the source given a class path for a class as described above? You may assume the source files are included in the jars for the framework.
    Thanks in advance.

    If there's a file named "package.subpack1.subpackn.DemoClassName.java" in a "demos" directory in the jar, then yes. You'd just use
    InputStream code = getResourceAsStream("/demos.package.subpack1.subpackn.DemoClassName.java");Or if those dots in the name actually separate directory names, i.e. you have a "package" directory under "demos" and a "subpack1" director under that and so on, then:
    InputStream code = getResourceAsStream("/demos/package/subpack1/subpackn/DemoClassName.java");

  • What are the classes used for bropdownListBox in BSP and purpose and how

    what are the classes used for bropdownListBox in BSP and purpose and how
    thank you,
    Regards.
    Jagrut BharatKumar Shukla

    Benje001,
    Right-click on the CWAI control on your form. Choose Properties. The first tab is the Channels tab. After you choose your device from the drop down box on the right, you can type in the Channels box which channel you want to use.
    If you want to see a CWAI control that is already configured, all of the shipping examples will have this already done.
    Also, if you have questions about any item on the CWAI (or any other NI ActiveX control) you can click the ? icon in the right corner of the properties page and then click on the item in the dialog that you need help with. This "What's this" help will describe that particular control on the dialog.
    Hope that helps!
    Regards,
    Shannon R.
    Applications Engineer
    National Instruments

  • What is the Popup class used for

    I always thought that a Popup should have some basic functionality, such as the pupup should close when:
    a) the escape key is pressed
    b) the popup loses focus
    The popup class provides none of the above functionality and in     fact seems to require some obscure code to
    even get the keyboard focus to work properly.
    Using a JWindow seems to provide the same functionality as a Popup.
    JPopupMenu seems to support both of the above requirements.
    Run the following program:
    a) click on each of the buttons
    b) click on an empty part of the frame
    It appears to me that whenever you need a "popup" you should use a JPopupMenu.
    Is the Popup class good for anything? Does it provide any functionality that I am not aware of?
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.text.*;
    public class PopupTest extends JFrame
         String[] numbers = { "one", "two", "three", "four", "five" };
         public PopupTest()
              getContentPane().setLayout( new FlowLayout() );
              JButton popup = new JButton("Popup as Popup");
              popup.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        popupPopup(e);
              getContentPane().add(popup);
              JButton window = new JButton("Window as Popup");
              window.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        windowPopup(e);
              getContentPane().add(window);
              JButton menu = new JButton("PopupMenu as Popup");
              menu.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        menuPopup(e);
              getContentPane().add(menu);
         private void popupPopup(ActionEvent e)
              JList list = new JList(numbers);
              list.setSelectedIndex(0);
              PopupFactory factory = PopupFactory.getSharedInstance();
              Popup popup = factory.getPopup(this, list, getLocation().x, getLocation().y);
              popup.show();
              Window window = SwingUtilities.windowForComponent(list);
              if (window != null)
                   window.setFocusableWindowState(true);
              KeyboardFocusManager.getCurrentKeyboardFocusManager().focusNextComponent(list);
         private void windowPopup(ActionEvent e)
              JList list = new JList(numbers);
              list.setSelectedIndex(0);
              JWindow window = new JWindow(this);
              window.getContentPane().add(list);
              window.pack();
              window.setVisible(true);
              window.setLocation(getLocation().x + 200, getLocation().y);
         private void menuPopup(ActionEvent e)
              JList list = new JList(numbers);
              list.setSelectedIndex(0);
              Component c = (Component)e.getSource();
              JPopupMenu menu = new JPopupMenu();
              menu.add(list);
              menu.show(c, 0, 0);
              list.requestFocusInWindow();
         public static void main(String[] args)
              PopupTest frame = new PopupTest();
              frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              frame.setSize(500, 200);
              frame.setLocationRelativeTo( null );
              frame.show();
    }

    you'd use Popup like JPopupMenu does, via a PopupFactoryYes you can get the Popu from the PopupFactory, but I think you are missing the point of my question. Popup has two methods, hide/show. It provides no other funtionality. I must write code to handle the escapce key and close the popup when it loses focus.
    When I use a JPopupMenu and add a component to the menu, it appears to add some listeners to the component to handle the escape key and loss of focus.
    I think it's safe to say that you're right when you say that it's preferable to use
    JPopupMenu (my experience as well).That was my conclusion, but I was just wondering it I was missing anything.
    It turns out that there are used in tooltips which, by essence, don't need any
    input from the user (whether keyboard or mouse) I guess thats what I was missing, only use a Popup in tooltip type situations.

  • Difference between narrow() method usage and simple class cast for EJB

    Hi,
    I have a very simple question:
    what is the difference between PortableRemoteObject.narrow(fromObj,
    toClass) method usage and simple class cast for EJB.
    For example,
    1)
    EJBObject ejbObj;
    // somewhere in the code the home.create() called for bean ...
    ABean a = (ABean)PortableRemoteObject.narrow(ejbObj,ABean.class);
    OR
    2)
    EJBObject bean;
    // somewhere in the code the home.create() called for bean ...
    ABean a = (ABean)ejbObj;
    Which one is better?
    P.S. I'm working with WL 6.1 sp2
    Any help would be appreciated.
    Thanks in advance,
    Orly

    [email protected] (Orly) writes:
    Hi,
    I have a very simple question:
    what is the difference between PortableRemoteObject.narrow(fromObj,
    toClass) method usage and simple class cast for EJB.
    For example,
    1)
    EJBObject ejbObj;
    // somewhere in the code the home.create() called for bean ...
    ABean a = (ABean)PortableRemoteObject.narrow(ejbObj,ABean.class);
    OR
    2)
    EJBObject bean;
    // somewhere in the code the home.create() called for bean ...
    ABean a = (ABean)ejbObj;
    Which one is better?(1) is mandated by the spec. It is required because CORBA systems may
    not have sufficient type information available to do a simple case.
    P.S. I'm working with WL 6.1 sp2 You should always use PRO.narrow()
    andy

  • Sun ONE Studio 4 aka Forte: How to set the output path for classes ?

    Help !
    Beginner's question:
    Sun ONE Studio 4 aka Forte:
    How to set the output path for classes ?
    As default, the class files are created in the same directory as the
    sources.
    In opposite, both JBuilder and Together support that there is a tree
    with the sources and another tree with the classes.
    The first answer I got was "not possible with Forte, but just if you write your own "ANT Build script" !
    a) Please point me to a ready-to-use ANT script for this purpose, if such is available
    b) Is using ANT instead of the MAKE as comfortable ? Besides the separation of sourcecode and classes, I would like to keep everything else to be the same, i.e. I don�t want to edit the ANT file if I enlarge the project by directories or files.
    Tia
    Sincerely
    Rolf

    You can set S1S's options to place newly created .class files in a specific location.
    Identify the compiler that is being used - Open the S1S's Tools/Options window, expand Editing and select Java Sources. Note the Default Compiler value. (If it's one if the Ant options, you use Ant to specify this option, not S1S.)
    Open the S1S's Tools/Options window, expand Building/Compiler Types and select the appropriate compiler.
    The Properties tab of the compiler has the property Target, which sets the filesystem where the compiler output is directed. If you choose <not set>, the .class files are written to their source directory.
    When you set the Target, your change affects all classes that use this compiler.
    Very few options can't be set in S1S; the challenge is finding out where they're set!

  • Is there any use for Class.getTypeParameters()?

    This is a quote from another Thread in this forum:
    How does erasure destroy reflection-related information? Methods getGenericInterfaces, getGenericSuperclass and getTypeParameters on java.lang.Class allow you to retrieve a lot of information on generic issues regarding a class. Obviously, that information is thus not destroyed.
    While I do agree that Generics do not destroy reflection, I wonder what they add to it.
    New types and methods are Class.getTypeParameters(), the interfaces java.lang.GenericDeclaration, java.lang.reflect.TypeParameter, java.lang.reflect.ParameterizedType etc...
    Could someone please give me an example of what I could do with all these new types and methods?
    It has been decided that Generics are implemented as a compile-time feature. At runtime, no information about the instantiated type parameters exists anymore. OK, so why clutter the core Java packages with a lot of seemingly useless new types and methods?

    Could someone please give me an example of what I
    could do with all these new types and methods?
    It has been decided that Generics are implemented as a
    compile-time feature. At runtime, no information about
    the instantiated type parameters exists anymore. OK,
    so why clutter the core Java packages with a lot of
    seemingly useless new types and methods?This is a very good question, and something I've been wondering about myself. I cannot determine how to get the runtime to give me an instance of WildcardType or ParamaterizedType, for example.
    Here's an extremely contrived example of how you can use Type bounds to effect runtime behaviour:
        class Processor<T> {       
        class StringProcessor<S extends String> extends Processor<S> {       
        public void whatKindOfProcessorIsItAnyway(Processor p) {
            Type processorType = p.getClass().getTypeParameters()[0].getBounds()[0];
            if ( String.class.equals(processorType) ) {
                System.out.println("I'm a string processor");
            } else {
                System.out.println("I process these: " + processorType);           
    whatKindOfProcessorIsItAnyway(new StringProcessor<String>());
            whatKindOfProcessorIsItAnyway(new Processor<Integer>());Outputs:
    I'm a string processor
    I process these: class java.lang.Object
    So you can see I can switch based on the type bounds compiled into the program, but I have no way of knowing that the second processor is actually instantiated with Integer, due to erasure.
    Infact, the only reason I would know anything about the actual type argument in the first instance is because String is final so '? extends String' -> String, for what its worth.
    Whether I can write a program that's actually useful using this information I've yet to determine, but I can imagine it could be useful for code generation.

  • Question about Classes

    I have a question concerning classes. In my main program I have a list box. I have gotten the index (using getSelectedIdex method) from the list box to use with my array. What I want to do is match the list box index with the array index to get the correct price from the array. I can do this in the main class, but was wondering if I could just do the calculations in another class. Can I pass the index of the list box to another class in order to do the calculations? I figure I could put the array in the other class too and match them. In order to do this, what would the class data member look like for the list box index that I have passed? I have tried and get errors, so was wondering if there was another way I can do this
    Thanks so much for your help

    I have a question concerning classes. In my main
    program I have a list box. I have gotten the index
    (using getSelectedIdex method) from the list box to
    use with my array. What I want to do is match the list
    box index with the array index to get the correct
    price from the array. I can do this in the main
    class, but was wondering if I could just do the
    calculations in another class. Yes you can, but why? The only reason to do this from a design point of view would be to seperate the logic into another class so that;-
    1. you might reuse the class in the future.
    2. the main method class has become large and cumbersome making it difficult to find all the methods.
    3. There are a variety of methods and subroutines in your application so that the logic in your program will be improved in terms of readability and future maintenance by creating seperate class files.
    4. 'whatever' other reasons (?)
    Can I pass the index of
    the list box to another class in order to do the
    calculations? I figure I could put the array in the
    other class too and match them. In order to do this,
    what would the class data member look like for the
    list box index that I have passed? I have tried and
    get errors, so was wondering if there was another way
    I can do this
    Sooner or later the would-be java programmer has to change or make the transition from using java as a procedural language and develop programs along more OOP lines. The answer to your question is "yes of course you can do this" and simply from the point of view of learning how to pass an argument to a different class, then yeah, learn how to do this.
    >
    Thanks so much for your help
    Gazoontite xxx

  • How to get the .class file for the extended Controller .java file

    Hi,
    I did the below steps.
    1. Created New OAWorkspace
    2. Created New project
    3. Imported the page .xml file
    4. Added new .java file by extending the controller class
    5. Added code in the .java file.
    6. Ran the .xml file
    As I copied all the folders from Unix box, the page was opened.
    But My question was where can I see the .class file the extended controller. It's a .java file. How to compile and get the .class file for this .java file. If I get this .class file, I can go to the page and click the personlize page. and change the Controller name to the new path by ftp ing the new class to the cust.oracle.apps.pos.changeorder.webiui.
    Please let me know how to create the .class file.
    Thanks,
    HP

    All are Java files are stored in JDEV_INSTALL_DIR:\jdevhome\jdev\myprojects\
    In your case the path java would be
    JDEV_INSTALL_DIR:\jdevhome\jdev\ myprojects \cust\oracle\apps\pos\changeorder\webui\
    AND
    Once you compile the java file in Jdeveloper, Class files get generated @ below path
    In your case the path of class would be
    JDEV_INSTALL_DIR:\jdevhome\jdev\ myclasses \cust\oracle\apps\pos\changeorder\webui\
    Duplicate Thread-
    Thanks
    --Anil
    http://oracleanil.blogspot.com/

Maybe you are looking for

  • Automatic outline sync between a BSO & ASO cube

    We have a BSO and ASO cube connected through replicated partition.The partition & data update seems to work fine.Our next objective is to sync any changes made to BSO outline to the ASO outline automatically. Can anyone provide any pointers as to how

  • Knowledge articles full compilation failed

    Hi, We have CRM 7.0 Interaction center. I executed the knowledge article full compilation by getting in to the IC_MANAGER business role. In the middle of the full compilation, the job failed with the reason MEMORY_NO_MORE_PAGING. Now basis corrected

  • Flex mobile ButtonSkin - multiline

    Hi, I can see how to extend and add my own borderskins to ButtonSkin, I can't however find away to make the text multiline. I would have though I should override createChildren and set a property on labelDisplay and labelDisplayShadow. I've tried lot

  • Deliver Complete and Delivery Groups

    Hello All I am an ABAPer, not an SD consultant, so please forgive me if my question is trivial.  I am working an issue in which I'm not sure if there is a config problem or an SAP problem. The scenario is that I have a sales BOM in a sales order that

  • Need to reinstall XP

    Hi I need to reinstall xp on my pc and dont want to loose some of the Albums i have bought from itunes store as well as the others i have put on my ipod. How can this be done. Thanks Paul