Help - Concept: Object and reference?

Q1:
In Java tutorial, it says: The real-world objects share two characteristics: They all have state and behavior.
State is associate with variables. So I am wondering where the object reference fit in the object if an object encapsulates some children objects? Is reference also varaibles?
For example, if a MailInBox object has the size property, numberOfMessage property and a reference to each message object, does this mean that MailInBox object has property of size, numberOfMessage and all references?
If reference belong to an object, an object can own both attribute properties and object references, right?
=================
Q2:
What is the clientship of an object?, please help give me an example.
Thanks!

Thanks for your reply.
For first question, My original question was whether an object can have both attribute properties and object references.
Here if a MainBox object has 1) a simple attribute "size" which is integer type, so "size" is the attribute of the MainBox; 2) At the same time, if a MainBox has a child object called "Inbox", so a MainBox object has a reference to the Inbox.
So in this sense, I concluded that an object can have both attribute properties (here is "size") and object references (here is "size"). Is it right?
This can also be inferred from your statements:
It is correct to assume that an object has attributes, which
simplistically reflect its state.Then,
Therefore, the Mail Box object only has 2 references.But In Java tutorial, it says: The real-world objects share two characteristics: They all have state and behavior.
Then I concluded that Both reference and attributes are variables, right?
=====
So is it safe to say, "an object can have attribute and reference"?
or
is it safe to say, "an object can have attribute with reference"?
Thanks!

Similar Messages

  • Guidelines to help center objects and text in pages

    Where are the guidelines to help centre objects and text in the new pages?

    well YMMV.  https://discussions.apple.com/thread/5472111?tstart=0
    You have to do it manually.  Also can be in the accomplished in the right hand column Format>Select your image>Arrange

  • Object and reference accessing for primitives, objects and collections

    Hi,
    I have questions re objects, primitives and collection accessing and references
    I made a simple class
    public class SampleClass {
         private String attribute = "default";
         public SampleClass()
         public SampleClass(SampleClass psampleClass)
              this.setAttribute(psampleClass.getAttribute());
              if (this.getAttribute() == psampleClass.getAttribute())
                   System.out.println("INSIDE CONSTRUCTOR : same object");
              if (this.getAttribute().equals(psampleClass.getAttribute()))
                   System.out.println("INSIDE CONSTRUCTOR : equal values");
         public void setAttribute(String pattribute)
              this.attribute = pattribute;
              if (this.attribute == pattribute)
                   System.out.println("INSIDE SETTER : same object");
              if (this.attribute.equals(pattribute))
                   System.out.println("INSIDE SETTER : equal values");
         public String getAttribute()
              return this.attribute;
         public static void main(String[] args) {
    ...and another...
    public class SampleClassUser {
         public static void main(String[] args) {
              SampleClass sc1 = new SampleClass();
              String test = "test";
              sc1.setAttribute(new String(test));
              if (sc1.getAttribute() == test)
                   System.out.println("SampleClassUser MAIN : same object");
              if (sc1.getAttribute().equals(test))
                   System.out.println("SampleClassUser MAIN : equal values");
              SampleClass sc2 = new SampleClass(sc1);
              sc1.setAttribute("test");
              if (sc2.getAttribute() == sc1.getAttribute())
                   System.out.println("sc1 and sc2 : same object");
              if (sc2.getAttribute().equals(sc1.getAttribute()))
                   System.out.println("sc1 and sc2 : equal values");
    }the second class uses the first class. running the second class outputs the following...
    INSIDE SETTER : same object
    INSIDE SETTER : equal values
    SampleClassUser MAIN : equal values
    INSIDE SETTER : same object
    INSIDE SETTER : equal values
    INSIDE CONSTRUCTOR : same object
    INSIDE CONSTRUCTOR : equal values
    INSIDE SETTER : same object
    INSIDE SETTER : equal values
    sc1 and sc2 : equal values
    ...i'm just curios why the last 3 lines are the way they are.
    INSIDE SETTER : same object
    INSIDE SETTER : equal values
    sc1 and sc2 : equal values
    how come while inside the setter method, the objects are the same object, and after leaving the setter method are not the same objects?
    Can anyone point a good book that shows in detail how objects, primitives and collections are referenced, especially when passed to methods. Online reference is preferred since the availability of books can be a problem for me.
    Thanks very much

    You are confusing references with objects.
    This compares two object references:
    if( obj1 == obj2 ) { // ...Whereas this compares two objects:
    if( obj1.equals(obj2) ) { // ...A reference is a special value which indicates where in memory two objects happen to be. If you create two strings with the same value they won't be in the same place in memory:
    String s1 = new String("MATCHING");
    String s2 = new String("MATCHING");
    System.out.println( s1 == s2 ); // false.But they do match:
    System.out.println( s1.equals(s2) ); // trueIf you're using a primitive then you're comparing the value that you're interested in. E.g.
    int x = 42;
    int y = 42;
    System.out.println(x == y); // trueBut if you're comparing references you're usually more interested in the objects that they represent that the references themselves.
    Does that clarify matters?
    Dave.

  • Help with Collections and Reference Cursor

    I have a procedure where I want to populate a table type and then return the results with a reference cursor so the results can be used by Hyperion. Here are the type declarations:
    create or replace type gg_audit_object as object (
                   owner varchar2(30),
                   table_name varchar2(30),
                   lag_time number)
    CREATE OR REPLACE TYPE gg_audit_table AS TABLE OF gg_audit_object
    and here's the procedure:
    CREATE OR REPLACE PROCEDURE ETSREP_GG_AUDIT_XX2 (results_cursor in out types.cursorType)
    AS
    v_owner varchar2(30);
    v_table_name varchar2(30);
    v_column_name varchar2(30);
    type v_record is record(
    owner varchar2(30),
    table_name varchar2(30),
    lag_time number);
    r1 v_record;
    t1 gg_audit_table;
    table_cr types.cursorType;
    sql_stmt varchar2(5000);
    cursor table_select is
    select g.owner,
    g.table_name,
    g.column_name
    from gg_tables_to_audit g
    where g.active_ind = 'Y'
    order by 1,2;
    BEGIN
    rec_count := 0;
    for main_rec in table_select loop
    sql_stmt := '';
    v_owner := main_rec.owner;
    v_table_name := main_rec.table_name;
    v_column_name := main_rec.column_name;
    sql_stmt := 'select '
    || '''' || v_owner || ''','
    || '''' || v_table_name || ''','
    || 'sysdate - max(' || v_column_name || ') '
    || 'from ' || v_owner || '.' || v_table_name;
    open table_cr for sql_stmt;
    FETCH table_cr into r1;
    close table_cr;
    -- here's where I'm stumped. I need to take the values from r1 and put them
    -- into t1.
    -- Something like this (or whatever is the correct way to do it)
    -- insert into table(t1) values (r1.owner, r1.table_name, r1.lag_time);
    end loop; -- end table_select loop
    -- and then open a reference cursor and select them out of t1.
    -- Something like
    -- open results_cursor for select * from t1;
    END;
    Just trying to avoid creating a real table and populating that. Any guidance would be greatly appreciated.

    Found the perfect example on Ask Tom. Here is the solution.
    create or replace package GG_AUDIT
    as
    type rc is ref cursor;
    procedure GG_AUDIT_PROC( r_cursor in out types.cursorType );
    end;
    create or replace package body GG_AUDIT
    as
    procedure GG_AUDIT_PROC( r_cursor in out types.cursorType )
    is
    l_data gg_audit_table := gg_audit_table();
    table_cr types.cursorType;
    type v_record is record(
    owner varchar2(30),
    table_name varchar2(30),
    lag_time number);
    r1 v_record;
    sql_stmt varchar2(5000);
    v_owner varchar2(30);
    v_table_name varchar2(30);
    v_column_name varchar2(30);
    rec_count number := 0;
    cursor table_select is
    select g.owner,
    g.table_name,
    g.column_name
    from gg_tables_to_audit g
    where g.active_ind = 'Y'
    order by 1,2;
    begin
    for main_rec in table_select loop
    sql_stmt := '';
    v_owner := main_rec.owner;
    v_table_name := main_rec.table_name;
    v_column_name := main_rec.column_name;
    sql_stmt := 'select '
    || '''' || v_owner || ''','
    || '''' || v_table_name || ''','
    || 'sysdate - max(' || v_column_name || ') '
    || 'from ' || v_owner || '.' || v_table_name;
    open table_cr for sql_stmt;
    FETCH table_cr into r1.owner, r1.table_name, r1.lag_time;
    close table_cr;
    rec_count := rec_count + 1;
    l_data.extend;
    l_data(rec_count) := gg_audit_object(r1.owner, r1.table_name, r1.lag_time);
    end loop;
    open r_cursor for select * from TABLE ( cast ( l_data as gg_audit_table) );
    end; -- end procedure
    end;
    Works perfectly. Thanks guys.

  • Object and Reference

    class A { }
    class B extends A { }
    A variable1 = new A(); // Legal --1
    B variable2 = new B(); // Legal --2
    A variable3 = new B(); // Legal, since B is a subclass of A --3
    B variable4 = new A(); // Illegal --4
    I understood 1 and 2,but not 3 and 4.could you please explain how?
    read few books ...but still confused

    We can assign object of subclass to superclass reference. Also, subclass is capable of doing all things that superclass can do plus some extra things(behaviour).
    public class Animal {
         public void drink(){
              System.err.println("Animal Wrinking Water");
    public class Dog extends Animal{
         public void drink(){
              System.err.println("Dog Drinking Water");
         public void bark(){
              System.err.println("Dog Barking...");
    public class TestPolymorphism{
         public static void main(String[] args){
              Animal animal = new Animal();
              animal.drink();  // Animal version of drink() called
              Animal animal1 = new Dog();
              animal1.drink(); // Dog version of drink() called
              Animal animal2 = new Dog();
              animal2.bark(); // Compiler Error, because bark() is not defined in Animal Class.
    }Hope this code clears your confusion.

  • Need HELP with objects and classes problem (program compiles)

    Alright guys, it is a homework problem but I have definitely put in the work. I believe I have everything right except for the toString method in my Line class. The program compiles and runs but I am not getting the right outcome and I am missing parts. I will post my problems after the code. I will post the assignment (sorry, its long) also. If anyone could help I would appreciate it. It is due on Monday so I am strapped for time.
    Assignment:
    -There are two ways to uniquely determine a line represented by the equation y=ax+b, where a is the slope and b is the yIntercept.
    a)two diffrent points
    b)a point and a slope
    !!!write a program that consists of three classes:
    1)Point class: all data MUST be private
    a)MUST contain the following methods:
    a1)public Point(double x, double y)
    a2)public double x ()
    a3public double y ()
    a4)public String toString () : that returns the point in the format "(x,y)"
    2)Line class: all data MUST be private
    b)MUST contain the following methods:
    b1)public Line (Point point1, Point point2)
    b2)public Line (Point point1, double slope)
    b3)public String toString() : that returns the a text description for the line is y=ax+b format
    3)Point2Line class
    c1)reads the coordinates of a point and a slope and displays the line equation
    c2)reads the coordinates of another point (if the same points, prompt the user to change points) and displays the line equation
    ***I will worry about the user input later, right now I am using set coordinates
    What is expected when the program is ran: example
    please input x coordinate of the 1st point: 5
    please input y coordinate of the 1st point: -4
    please input slope: -2
    the equation of the 1st line is: y = -2.0x+6.0
    please input x coordinate of the 2nd point: 5
    please input y coordinate of the 2nd point: -4
    it needs to be a diffrent point from (5.0,-4.0)
    please input x coordinate of the 2nd point: -1
    please input y coordinate of the 2nd point: 2
    the equation of the 2nd line is: y = -1.0x +1.0
    CODE::
    public class Point{
         private double x = 0;
         private double y = 0;
         public Point(){
         public Point(double x, double y){
              this.x = x;
              this.y = y;
         public double getX(){
              return x;
         public double setX(){
              return this.x;
         public double getY(){
              return y;
         public double setY(){
              return this.y;
         public String toString(){
              return "The point is " + this.x + ", " + this.y;
    public class Line
         private double x = 0;
         private double y = 0;
         private double m = 0;
         private double x2 = 0;
         private double y2 = 0;
         public Line()
         public Line (Point point1, Point point2)
              this.x = point1.getX();
              this.y = point1.getY();
              this.x2 = point2.getX();
              this.y2 = point2.getY();
              this.m = slope(point1, point2);
         public Line (Point point1, double slope)
              this.x = point1.getX();
              this.y = point1.getY();
         public double slope(Point point1, Point point2)//finds slope
              double m1 = (point1.getY() - point2.getY())/(point1.getX() - point2.getX());
              return m1;
         public String toString()
              double temp = this.x- this.x2;
              return this.y + " = " +temp + "" + "(" + this.m + ")" + " " + "+ " + this.y2;
              //y-y1=m(x-x1)
    public class Point2Line
         public static void main(String[]args)
              Point p = new Point(3, -3);
              Point x = new Point(10, 7);
              Line l = new Line(p, x);
              System.out.println(l.toString());
    }My problems:
    I dont have the right outcome due to I don't know how to set up the toString in the Line class.
    I don't know where to put if statements for if the points are the same and you need to prompt the user to put in a different 2nd point
    I don't know where to put in if statements for the special cases such as if the line the user puts in is a horizontal or vertical line (such as x=4.7 or y=3.4)
    Edited by: ta.barber on Apr 20, 2008 9:44 AM
    Edited by: ta.barber on Apr 20, 2008 9:46 AM
    Edited by: ta.barber on Apr 20, 2008 10:04 AM

    Sorry guys, I was just trying to be thorough with the assignment. Its not that if the number is valid, its that you cannot put in the same coordinated twice.
    public class Line
         private double x = 0;
         private double y = 0;
         private double m = 0;
         private double x2 = 0;
         private double y2 = 0;
         public Line()
         public Line (Point point1, Point point2)
              this.x = point1.getX();
              this.y = point1.getY();
              this.x2 = point2.getX();
              this.y2 = point2.getY();
              this.m = slope(point1, point2);
         public Line (Point point1, double slope)
              this.x = point1.getX();
              this.y = point1.getY();
         public double slope(Point point1, Point point2)//finds slope
              double m1 = (point1.getY() - point2.getY())/(point1.getX() - point2.getX());
              return m1;
         public String toString()
              double temp = this.x- this.x2;
              return this.y + " = " +temp + "" + "(" + this.m + ")" + " " + "+ " + this.y2;
              //y-y1=m(x-x1)
    public class Point2Line
         public static void main(String[]args)
              Point p = new Point(3, -3);
              Point x = new Point(10, 7);
              Line l = new Line(p, x);
              System.out.println(l.toString());
    }The problem is in these lines of code.
    public double slope(Point point1, Point point2) //if this method finds the slope than how would i use the the two coordinates plus "m1" to
              double m1 = (point1.getY() - point2.getY())/(point1.getX() - point2.getX());
              return m1;
         public String toString()
              double temp = this.x- this.x2;
              return this.y + " = " +temp + "" + "(" + this.m + ")" + " " + "+ " + this.y2;
              //y-y1=m(x-x1)
         }if slope method finds the slope than how would i use the the two coordinates + "m1" to create a the line in toString?

  • Calling DrClap to help with objects and AbstractTableModel

    Hi DrClap,
    I am trying to implement the AbstractTableModel using objects as containers of data. Every thing works till the data is displayed, while setting the data, I am having trouble.
    I am using reflection to get the bean getter and setter methods. Also I have restricted the fields displayed using column names passed from config file. Also how do you go about doing data validation? I was thinking more on the lines of column validator classes which do the validation and display the cells having errors with a different color.
    You have mentioned in reply 17 of this thread that you have implemented this functionality.
    Could you please paste sample code? If the code is too large, could you please mail this to me? My email is [email protected] . I have been searching high and low for the last few days without any positive response.
    Thanks in advance.

    Found out how to do this...
    I had to create a config file to specify the various bean properties like get/set method names. This is because reflection gives other values other than get and set methods.

  • Help with objects and classes

    the only problems i have is getting the bestTime value to display at the end and also getting the proper message dialog boxes to appear by calling the other program instead of putting JOptionPane.showInputDialog...... in this part
    Swimmer swim = new Swimmer();
              swim.setName(JOptionPane.showInputDialog(null, "Input user's name"));
              swim.setInitTime(Double.parseDouble(JOptionPane.showInputDialog(null, "Enter initial time")));
              swim.setFinTime(Double.parseDouble(JOptionPane.showInputDialog(null, "Enter final time")));there should be a way i can call the other program where i have the methods in but im not sure as to how to do it.
    import javax.swing.JOptionPane;
    public class Swimmer
         private String name;
         private double initTime;
         private double finalTime;
         private double bestTime = 0;
         public void setName(String n)
              name = n;
         public void setInitTime(double t)
              initTime = t;
         public void setFinTime(double f)
              finalTime = f;
         public void setBest(double b)
              bestTime = b;
         public String getName()
         String userName = "";
              userName = JOptionPane.showInputDialog(null,
              "Input swimmer's name");
              return name;
         public double getInitTime()
              double initialT;
              initialT = Double.parseDouble(
                   JOptionPane.showInputDialog(null, "Enter initial time"));     
              return initTime;
         public double getFinTime()
              double finalT;
              finalT = Double.parseDouble(
                   JOptionPane.showInputDialog(null, "Enter final time"));
              return finalTime;
         public double getBest(double initTime, double finalTime)
              initTime = 0;
              finalTime = 0;     
              double bestTime = 0;
              if (finalTime > initTime)
                   bestTime = initTime;
              else
                   if (initTime > finalTime)
                        bestTime = finalTime;
                   return bestTime;
         public void output()
         String outString = "";
         outString += name + "\n";
         outString += "Best Time: " + bestTime + " seconds\n";
         JOptionPane.showMessageDialog(null, outString);
    }new other java file. the problem i was talking about up top is for this program. instead of using the joption dialog boxes there should be a way to call the other program where i have methods but im not sure how to do it.
    import javax.swing.JOptionPane;
    public class Swimmer2
         public static void main(String[] args)
              Swimmer swim = new Swimmer();
              swim.setName(JOptionPane.showInputDialog(null, "Input user's name"));
              swim.setInitTime(Double.parseDouble(JOptionPane.showInputDialog(null, "Enter initial time")));
              swim.setFinTime(Double.parseDouble(JOptionPane.showInputDialog(null, "Enter final time")));
              swim.output();
    }

    swim.setName(swim.getName());would seem to work.
    Very odd design though.

  • Reference Objects and Pooling

    I am trying to create a Pool class that does not require the caller to explictly return the objects. I thought I might be able to use Phantomreference or WeakReference to detect when the user no longer had reference to the object and thus reclaim it and put it back in the pool. The issues with these are this:
    1) WeakReference is cleared (clear()) before it is added to the ReferenceQueue not to mention the object is finalised before as well.
    2) PhantomReference is not cleared but it is finalized. Not that it matters because you can never access the referant.
    So what I did is subclass PhantomReference and created an Interface called Proxy. The subclass would take a proxy referant containing the actual reclaimable object and it would store the relaimable object as a hard referant and the proxy to that as the Phantom referant. Thus when the client was no longer using the proxy the erference would be added to the reference queue and I could get the actual reclaimable object as opposed to the proxy via a call to get().
    The problem with this approach has been that not all classes lend well to being proxied. The idea situation would be that the Proxy would extend the actual class thus CASTING would work as normal.
    public StringBufferProxy extends StringBuffer implements Proxy {
    private StringBuffer proxy;
    public StringBufferProxy(StringBuffer proxy)
    this.proxy = proxy;
    public Object getProxied()
    return proxy;
    public void anyMethod()
    proxy.anyMethod();
    The obvious problem with the above is that StringBuffer is final and thus can't be extended. Similar problems with Thread as it relates to its final methods. So in the end after going around in circles for awhile I realized this concept would only really be practicle for Interface based classes.
    Has anyone else worked this problem and solved it?
    }

    all cases the referant has allready been finalized. In...
    So what I tried to do was create a proxy class that
    wraps the actual pooled item....
    This has numerous problems.You may like my method. Someone needs to tell me if this is a ``bad thing'' but I've used it quite successfully. I wrote a cache class a little while ago (very similar to your Pool needs). It's a cloning cache. Let me simplify a VERY complex cache:
    class Clone implements Cloneable {
        private Object o;
        Clone(Object o) {
            super();
            this.o = o;
        public Object getObject() { return o; }
        public Clone getClone() throws ... {
            return (Clone)super.clone();
    } // CloneThis sets up the clone, now:
    class CloneReference extends WeakReference implements Comparable { // or extend any Reference that makes sense to you
        private Clone clone = null;
        CloneReference(Clone referent, ReferenceQueue q) throws ... {
            super(referent,q);
            try {  // don't really have to try, but...
                clone = (Clone)referent.getClone();
            } catch(Exception dowhatever) { ... }
        public Object getObject() {
            Object ret = null;
            if(clone!=null) ret = clone.getObject();
            return ret;
        // now implement Comparable
    } // CloneReferenceNow in your Pool maintain your ReferenceQueue, when you add a new Object into it, purgue this queue. In my cache I have a CacheEvent/CacheListener that is event fired during the purging of this queue. More later. When adding a new object into your Pool, add a reference to a new CloneReference object:
    private ReferenceQueue q;  // init elsewhere
    public void add(Object o) throws ... {
        CloneReference cr = new CloneReference(
              new Clone(obj)
            , q
        // now add this cr, not the o
    }When purging the queue, poll() your ReferenceQueue and then obtain the CloneReference. Get your object back out (this will not be null or yet finalized) using CloneReference.getObject(), then fire off your interpretation of my CacheEvent to your version of my CacheListener.
    Note that the ReferenceQueue maintains a reference to the original Clone, but the Reference itself has a clone of that Clone which we will NOT be GCd or nullified still maintaining a reference to the original object.
    If you need further help I can probably provide a truncated source of a simple Cache.

  • Help required with understanding References and finalizers

    Background
    I have an online Application which has been developed over 6 years now. It is a Website CMS and runs 300 simultaneous sites per webserver. For the first time I am experiencing capacity / performance issues. I switched from SUN Java to JROCKIT in 2006 which speeded evertything up by 200% but now I have periods of the day where The memory fills up and I get Swapping which leads to 100% cpu utilization - mainly in I/O. I have upped the RAM in the server as a solution and now I want to see if I can do anything to reduce my memory footprint.
    Specifically : The question
    I have captured stats which I can view in Mission Control and it shows that the number of Weak References increases continuously over a 4 hour period (also the number of Phantom references shows similar behaviour). Therefore I suspect a memory leak - Also I suspect that this is of my own making since I have not realy had to deal with this before. The thing is I cannot clearly see how to proceed and identify what my error is.
    I have spent a couple of weeks reading loads of docs about weak / stong etc.. references but I realy need a bit of help with zeroing in on a starting point. I know that I release objects by setting them to null but I now expect that this is not realy good enough.
    Anyway - before I ramble too long, If there is anyone with relevant experience and a few minutes I would be very gratefull to hear from them.
    Regards
    Jonathan Carter
    Glimworm IT
    Amsterdam

    Hi Jonathan,
    Reference objects and finalizers are a frequent cause of performance issues. The reason is that 1) objects tend to be kept alive longer, leading to an increase in live data and more frequent GC and 2) processing of these objects during GC is expensive, which leads to more time spent in GC, i.e. long pause times.
    There are various ways you can approach your issue. One is to use -Xverbose to see what you find. If you are using JRockit R27.2 or later, run with "-Xverbose:referents" to get a list of all reference objects at every GC. More info:
    http://edocs.bea.com/jrockit/jrdocs/refman/optionX.html#wp1029960
    Note that you can enable verbose logging during runtime through "jrcmd <pid> verbosity set=referents" and later disable it using "jrcmd <pid> verbosity set=referents=warn". No JVM restart required.
    If you send your JRA recordings to jrockit-improve AT bea DOT com, we'll try to take a look at them.
    -- Henrik

  • Re: Beginner needs help using a array of class objects, and quick

    Dear Cynthiaw,
    I just read your Beginner needs help using a array of class objects, and quick of Dec 7, 2006 9:25 PM . I really like your nice example.
    I also want to put a question on the forum and display the source code of my classe in a pretty way as you did : with colors, indentation, ... But how ? In html, I assume. How did you generate the html code of your three classes ? By help of your IDE ? NetBeans ? References ?
    I already posted my question with six source code classes ... in text mode --> Awful : See "Polymorphism did you say ?"
    Is there a way to discard and replace a post (with html source code) in the Sun forum ?
    Thanks for your help.
    Chavada

    chavada wrote:
    Dear Cynthiaw,
    I just read your Beginner needs help using a array of class objects, and quick of Dec 7, 2006 9:25 PM . I really like your nice example.You think she's still around almost a year later?
    I also want to put a question on the forum and display the source code of my classe in a pretty way as you did : with colors, indentation, ... But how ?Just use [code] and [/code] around it, or use the CODE button
    [code]
    public class Foo() {
      * This is the bar method
      public void bar() {
        // do stuff
    }[/code]

  • How to get subject text and Reference Object both Screens at the Header lev

    Dear Experts ,
                    I am getting only Notification Header Screen ( Subject Text, Notification system and User Status) at the Header of Notification and different Tabs under that screen.
                    I want Subject Text and Reference Object screens at header Level so that any screen Tab selected at a time I can see the Subject and Reference Object of the Notification.
                    Pls tell me is there any way so I can Include 2 screens( Subject and Reference Object at the Header Level.)
    With best regards,
    Narendra

    Narendra,
    You can't in the standard system.
    Only the tabs are configurable.
    PeteA

  • Differences between object and object references

    What's the differences between object and object references? To me, it seems the same, but I am sure there are differences.
    Student s = new Student("Joe",20);
    s is an object of class Student. Can we say s is an object reference of class Student?
    Please clarify. thanks!!

    Student s = new Student("Joe",20);
    s is an object of class Student. Can we say s is an
    object reference of class Student?The thing you created via "new Student()" is an object. The variable you declared via "Student s" contains a reference to that object. People say all kinds of things but I find it clearer to differentiate between variables and the objects they refer to.

  • Help regarding ABAP and ABAP Objects

    Dear all,
    I am very new in abap and abap objects. But i have some expr. in other language..specialy development. Right now i am working for srm module...So i want to move my self into abap object and specialy in workflow...Please provide me help regarding this...along with the starting point for this.
    Best Regards
    Vijay Patil

    hi
    Object Oriented prg
    A programming technique in which solutions reflect real world objects
    What are objects ?
    An object is an instantiation of a class. E.g. If “Animal” is a class, A cat
    can be an object of that class .
    With respect to code, Object refers to a set of services ( methods /
    attributes ) and can contain data
    What are classes ?
    A class defines the properties of an object. A class can be instantiated
    as many number of times
    Advantages of Object Orientated approach
    Easier to understand when the system is complex
    Easy to make changes
    Encapsulation - Can restrict the visibility of the data ( Restrict the access to the data )
    Polymorphism - Identically named methods behave differently in different classes
    Inheritance - You can use an existing class to define a new class
    Polymorphism and inheritance lead to code reuse
    Have a look at these good links for OO ABAP-
    http://www.sapgenie.com/abap/OO/
    http://www.sapgenie.com/abap/OO/index.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
    http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt
    http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
    http://www.allsaplinks.com/
    http://www.sap-img.com/
    http://www.sapgenie.com/
    http://help.sap.com
    http://www.sapgenie.com/abap/OO/
    http://www.sapgenie.com.
    http://www.sapgenie.com/abap/OO/index.htm
    http://www.sapgenie.com/abap/controls/index.htm
    http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
    http://www.sapgenie.com/abap/OO/index.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    http://www.sapgenie.com/abap/OO/
    check the below links lot of info and examples r there
    http://www.sapgenie.com/abap/OO/index.htm
    http://www.geocities.com/victorav15/sapr3/abap_ood.html
    http://www.brabandt.de/html/abap_oo.html
    Check this cool weblog:
    /people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
    /people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b6254f411d194a60000e8353423/frameset.htm
    http://www.sapgenie.com/abap/OO/
    http://www.sapgenie.com/abap/OO/index.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
    http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt
    http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
    http://www.allsaplinks.com/
    http://www.sap-img.com/
    http://www.sapgenie.com/
    http://help.sap.com
    http://www.sapgenie.com/abap/OO/
    http://www.sapgenie.com/abap/OO/index.htm
    http://www.sapgenie.com/abap/controls/index.htm
    http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
    http://www.sapgenie.com/abap/OO/index.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    http://www.sapgenie.com/abap/OO/
    these links
    http://help.sap.com/saphelp_47x200/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm
    For funtion module to class
    http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm
    for classes
    http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5c54f411d194a60000e8353423/content.htm
    for methods
    http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm
    for inheritance
    http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm
    for interfaces
    http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm
    For Materials:
    1) http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf -- Page no: 1291
    2) http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
    3) http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    4) http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
    5) http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
    6) http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
    7) http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
    8) http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8
    1) http://www.erpgenie.com/sap/abap/OO/index.htm
    2) http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    Hope this helps
    if it helped, you can acknowledge the same by rewarding
    regards
    ankit

  • Rmi and reference to remote object

    how I can obtain a reference to a remote object and not its value?

    This will happen automatically once it is exported and you return it from the server via an RMI call, e.g. Naming.lookup() or as the result of another remote method.

Maybe you are looking for

  • The best file server for a Mac Office

    Hi Guys, I work a a small gallery, we have about 5 iMacs, a couple of laptops, a few ipads / iphones and right now we're working off 2 Synology DS212j NAS drives attached to our Airport Extreme. The iMacs are all hardwired to the network through a gi

  • What video card should I purchase for old iMac?

    I have an old Mac 24 inch, and it seems that the video card is not working. How do I find which video card to purchase? I have a serial number.

  • Battery not recognized

    Hey, Recently, my MacBook hasn't been recognizing that I have a battery installed (it shows the battery with an "x" sign at the top. For a while this did not affect the use of the battery, but today it stopped working altogether without a power cord.

  • Create reversal document with BAPI: BAPI_ACC_DOCUMENT_POST.

    Hi Guys, I am Create reversal document with BAPI: BAPI_ACC_DOCUMENT_POST.First I am post financial document with BAPI BAPI_ACC_DOCUMENT_POST and Same Document. i am Reversal  with same BAPI 'BAPI_ACC_DOCUMENT_POST'. New reversal docment is created. b

  • Changing default apple id for app update

    When I go into the app store and try to update all, it goes to a different apple id by default.  It says I'm logged into my ID but goes to a different one.  How do I fix this problem?