Instance/Class Variables/Methods

Can someone please give a CLEAR explanation on what is a Instance Variable, Instance Method, Class Variable, and Class Method? Thanks a lot!

instance method and variable is one that requires an instance to be created before they can be used.
Class method and variables don't need an instance. They have the static qualifier.
For example
public class Test {
    public String instanceVar;
    static public String classVar;
}Now to use instanceVar you have to do this
Test test = new Test();
test.instanceVar = "";To use classVar
Test.classVar = "";Another way of looking at it is that each instance of a class (created using new) has its own copy of instance variables.
Multiple instances of a class however share the same copy of class variables.
The same pretty much goes for methods.

Similar Messages

  • Initial values to instance & class variable

    I read in the book that instance & class variable definitions are given an initial value depending on the type of information they hold:
    Numeric variable - 0
    Characters - '\0'
    Boolean - false
    Objects - null
    But when I try to compile a class without giving explict value to the variable I get error.
    So why do I need this initial value - if it can't be used any way?

    Sorry� I'll try to make my question clearer.
    As I wrote in my previous message, I read in the book that instance & class variable definitions are given an initial value depending on the type of information they hold:
    Numeric variable - 0
    Characters - '\0'
    Boolean - false
    Objects - null
    From the above I understand that whenever I declare a variable without assigning it a value, it automatically has an initial value.
    For example:
    Class Myclass(){
    Int x;
    Static int z;
    Void fooMyClass(){
    Int y;
    I understand from what I read in the book, both x, y & z - get default values of zero. Is that correct?
    if it is correct, why can't I use these values that were assign as default?

  • Wrapper classes/ instance variables&methods

    can anyone provide me additional information on the wrapper classes.
    In addition, could someone please provide an explination of the- instance and class (variables+methods)

    Every primitive class has a wrapper class e.g.
    int - Integer
    float - Float
    long - Long
    char - Character
    etc. When a primitive is wrapped it becomes an object and immutable. Primitives are generally wrapped (either to make them immutable) or to be able to add them to the collections framework(sets, maps, lists which can only take objects, not primitives).
    An instance variable is a variable that each copy of the object you create contains, as is an instance method. Each instance you create (each copy of the object) contains its own copy of the variable and method.
    A class variable and method means that no matter how many objects you create, there will be one and only one copy of the variable and method.
    Hope this helps. Also see the java tutorial.

  • Create an instance of my class variable

    Hello all,
    I'm a newbie to iPhone/iPad programming and am having some trouble, I believe the issue is that I'm not creating an instance of my class variable.  I've got a class that has a setter and a getter, I know about properties but am using setters and getters for the time being.  I've created this class in a View-based application, when I build the program in XCode 3.2.6 everything builds fine.  When I step through the code with the debugger there are no errors but the setters are not storing any values and thus the getters are always returning 0 (it's returning an int value).  I've produced some of the code involved and I was hoping someone could point out to me where my issue is, and if I'm correct about not instantiating my variable, where I should do that.  Thanks so much in advance.
    <p>
    Selection.h
    @interface Selection : NSObject {
      int _choice;
    //Getters
    -(int) Choice;
    //Setters
    -(void) setChoice:(int) input;
    Selection.m
    #import "Selection.h"
    @implementation Selection
    //Getters
    -(int)Choice {
      return _choice;
    //Setter
    -(void)setChoice:(int)input{
              _choice = input;
    RockPaperScissorsViewController.m
    #import "RockPaperScissorsViewController.h"
    @implementation RockPaperScissorsViewController
    @synthesize rockButton, paperButton, scissorsButton, label;
    //@synthesize humanChoice, computerChoice;
    -(void)SetLabel:(NSString *)selection{
              label.text = selection;
    -(IBAction)rockButtonSelected {
    //          [self SetLabel:@"Rock"];
              [humanChoice setChoice:1];
    </p>
    So in the above code it's the [humanChoice setChoice:1] that is not working.  When I step through that portion with the debugger I get no errors but when I call humanChoice.Choice later on in the code I get a zero.
    -NifflerX

    It worked, thank you so much.  I put
    humanChoice = [[Selection alloc]init];
    In viewDidLoad and it worked like a charm.  Thank you again.
    -NifflerX

  • Static Classes/Methods vs Objects/Instance Classes/Methods?

    Hi,
    I am reading "Official ABAP Programming Guidelines" book. And I saw the rule:
    Rule 5.3: Do Not Use Static Classes
    Preferably use objects instead of static classes. If you don't want to have a multiple instantiation, you can use singletons.
    I needed to create a global class and some methods under that. And there is no any object-oriented design idea exists. Instead of creating a function group/modules, I have decided to create a global class (even is a abstract class) and some static methods.So I directly use these static methods by using zcl_class=>method().
    But the rule above says "Don't use static classes/methods, always use instance methods if even there is no object-oriented design".
    The book listed several reasons, one for example
    1-) Static classes are implicitly loaded first time they are used, and the corresponding static constructor -of available- is executed. They remain in the memory as long as the current internal session exists. Therefore, if you use static classes, you cannot actually control the time of initialization and have no option to release the memory.
    So if I use a static class/method in a subroutine, it will be loaded into memory and it will stay in the memory till I close the program.
    But if I use instance class/method, I can CREATE OBJECT lo_object TYPE REF TO zcl_class then use method lo_object->method(), then I can FREE  lo_object to delete from the memory. Is my understanding correct?
    Any idea? What do you prefer Static Class OR Object/Instance Class?
    Thanks in advance.
    Tuncay

    @Naimesh Patel
    So you recommend to use instance class/methods even though method logic is just self-executable. Right?
    <h3>Example:</h3>
    <h4>Instance option</h4>
    CLASS zcl_class DEFINITION.
      METHODS add_1 IMPORTING i_input type i EXPORTING e_output type i.
      METHODS subtract_1 IMPORTING i_input type i EXPORTING e_output type i.
    ENDCLASS
    CLASS zcl_class IMPLEMENTATION.
      METHOD add_1.
        e_output = i_input + 1.
      ENDMETHOD.
      METHOD subtract_1.
        e_output = i_input - 1.
      ENDMETHOD.
    ENDCLASS
    CREATE OBJECT lo_object.
    lo_object->add_1(
      exporting i_input = 1
      importing e_output = lv_output ).
    lo_object->subtract_1(
      exporting i_input = 2
      importing e_output = lv_output2 ).
    <h4>Static option</h4>
    CLASS zcl_class DEFINITION.
      CLASS-METHODS add_1 IMPORTING i_input type i EXPORTING e_output type i.
      CLASS-METHODS subtract_1 IMPORTING i_input type i EXPORTING e_output type i.
    ENDCLASS
    CLASS zcl_class IMPLEMENTATION.
      METHOD add_1.
        e_output = i_input + 1.
      ENDMETHOD.
      METHOD subtract_1.
        e_output = i_input - 1.
      ENDMETHOD.
    ENDCLASS
    CREATE OBJECT lo_object.
    lo_object->add_1(
    zcl_class=>add_1(
      exporting i_input = 1
      importing e_output = lv_output ).
    lo_object->subtract_1(
    zcl_class=>subtract_1(
      exporting i_input = 2
      importing e_output = lv_output2 ).
    So which option is best? Pros and Cons?

  • Class variables outside of method scope?

    Hey guys,
    I have 3 text fields. 2 are meant for input and 1 for output. I want to take the float values from the 2 input text fields and do some math on them and then output the results in the output text field. Heres the problem, I need to make sure that both the text fields have some value stored in them. Well, that's not the problem, the problem is that the method only seems to be able to check the 'textField' parameter thats passed into the method pasted below. Whenever I try to run checks on the textfield class variables specifically, it doesn't seem to pick up on any of the text field's value changes or anything... Any ideas?
    I have the following:
    - (void)textFieldDidEndEditing:(UITextField *)textField {
    if([heightText.text length] > 0 && [weightText.text length] > 0) {
    bmiText.text = @"hi";
    else if([textField.text length] > 0) {
    bmiText.text = @"atleast this works";
    else {
    bmiText.text = @"";

    Here is the .h file:
    @interface BMIViewController : UIViewController {
    //...some other variables
    UITextField *heightText;
    UITextField *weightText;
    @property (nonatomic, retain) UITextField *heightText;
    @property (nonatomic, retain) UITextField *weightText;
    Here is the .m file:
    @implementation BMIViewController
    @synthesize weightText, heightText;
    //...some code...
    - (void)textFieldDidEndEditing:(UITextField *)textField {
    if([heightText.text length] > 0 && [weightText.text length] > 0) {
    bmiText.text = @"hi";
    else if([textField.text length] > 0) {
    bmiText.text = @"atleast this works";
    else {
    bmiText.text = @"";

  • Reassign class variable to a blank instance of its class

    When I declare a class variable
    private var myVar:MyClass = new MyClass();
    It creates a new instance of that class that will trace as [Object MyClass].
    However, as soon as I assign it to something
    myVar = thisOtherVar;
    It will now trace as [Object thisOtherVar].
    I need to get it back to where it's just an "empty" blank class instance, if that makes any sense at all.
    How do I go about doing that? Thanks!

    I'm brand new to OOP - I've been watching iTunes U videos and reading books but it's still all pretty abstract in my mind and it's difficult for me to pin point how all that stuff translates to actually writing good code.
    Basically, it's an open ended kid's dictionary. You drag the lettes to drop boxes, touch the check to see if it's a word, and then a picture representing the word pops up on the screen.
    All of it works except if you try to remove a letter that's already been placed. Originally, I wanted the check button to do a sweep of the dropped letters and see if they had formed a word - but I couldn't figure out a way to do that. So then I started tracking movements of letters in real time, and that's when it got really confusing. I think I just need to start over and try to make the code a bit cleaner. Right now this is what I've got:
    if (currentUsedBlank is BlankSquare) {  //if they have removed a letter that has already been dropped
                    if (currentUsedBlank != currentBlank) { //and it's been placed back on a different square
                        currentUsedBlank.letter = null;
                else {
                    currentUsedBlank.letter = null;
                if (this.dropTarget.parent is BlankSquare && currentBlank.letter == null) {
                    SpellingGlobals.lettersInBlanks[SpellingGlobals.lettersInBlanks.length] = this;
                    this.x = this.dropTarget.parent.x + 10;
                    this.y = this.dropTarget.parent.y - 10;
                    var myClass:Class = getDefinitionByName(getQualifiedClassName(MovieClip(this))) as Class;
                    var newLetter:MovieClip = new myClass();
                    newLetter.x = currentLetter.startPoint.x;   
                    newLetter.y = currentLetter.startPoint.y;
                    newLetter.letter = currentLetter.letter;
                    newLetter.reference = currentLetter.reference;
                    newLetter.startPoint.x = currentLetter.startPoint.x;
                    newLetter.startPoint.y = currentLetter.startPoint.y;
                    newLetter.isVowel = currentLetter.isVowel;
                    currentBlank.letter = currentLetter.letter;
                    if (SpellingGlobals.isCaps == true) {
                        newLetter.txt.text.toUpperCase();
                        if (SpellingGlobals.isColor == true) {
                            if (newLetter.isVowel) {
                                newLetter.txt.textColor = SpellingGlobals.colorVowel;
                            else {
                                newLetter.txt.textColor = SpellingGlobals.colorCon;
                    MovieClip(root).addChild(newLetter);
                    SpellingGlobals.copiedLetters[SpellingGlobals.copiedLetters.length] = newLetter;
                    currentBlank.alpha = 0;
                else {
                    this.x = MovieClip(this).startPoint.x;
                    this.y = MovieClip(this).startPoint.y;
                this.stopDrag();

  • Convertion of class variable (static) into instance variable(non-static)!

    Dear all,
    got a slight different question.
    Is that possible to convert class variable (static) into instance variable(non-static)?
    If so, how to make the conversion?
    Appreciating your replies :)
    Take care all,
    Leslie V
    http://www.googlestepper.blogspot.com
    http://www.scrollnroll.blogspot.com

    JavaDriver wrote:
    Anything TBD w.r.to pass by value/reference (without removing 'static' keyword)?Besides the use of acronyms in ways that don't make much sense there are two other large problems with this "sentence".
    1) Java NEVER passes by reference. ALWAYS pass by value.
    2) How parameters are passed has exactly zero to do with static.
    Which all means you have a fundamentally broken understanding of how Java works at all.
    Am I asking something apart from this?
    Thanks for your reply!
    Leslie VWhat you're asking is where to find the tutorials because you're lost. Okay. Here you go [http://java.sun.com/docs/books/tutorial/java/index.html]
    And also for the love of god read this [http://www.javaranch.com/campfire/StoryPassBy.jsp] There is NO excuse for not knowing pass-by in Java in this day and age other than sheer laziness.

  • How to access the parent class variable or object in java

    Hi Gurus,
    I encounter an issue when try to refer to parent class variable or object instance in java.
    The issue is when the child class reside in different location from the parent class as shown below.
    - ClassA and ClassB are reside in xxx.oracle.apps.inv.mo.server;
    - Derived is reside in xxx.oracle.apps.inv.mo.server.test;
    Let say ClassA and ClassB are the base / seeded class and can not be modified. How can i refer to the variable or object instance of ClassA and ClassB inside Derived class.
    package xxx.oracle.apps.inv.mo.server;
    public class ClassA {
        public int i=10;
    package xxx.oracle.apps.inv.mo.server;
    public class ClassB extends ClassA{
        int i=20;   
    package xxx.oracle.apps.inv.mo.server.test;
    import xxx.oracle.apps.inv.mo.server.ClassA;
    import xxx.oracle.apps.inv.mo.server.ClassB;
    public class Derived extends ClassB {
        int i=30;
        public Derived() {
           System.out.println(this.i);                  // this will print 30
           System.out.println(((ClassB)this).i);  // error, but this will print 20 if Derived class located in the same location as ClassB
           System.out.println(((ClassA)this).i);  // error, but this will print 20 if Derived class located in the same location as ClassA
        public static void main(String[] args) { 
            Derived d = new Derived(); 
    Many thanks in advance,
    Fendy

    Hi ,
    You cannot  access the controller attribute instead create an instance of the controller class and access the attribute in the set method
    OR create a static method X in the controller class and store the value in that method. and you can access the attribute by 
    Call method class=>X
    OR if the attribute is static you can access by classname=>attribute.
    Regards,
    Gangadhar.S
    Edited by: gangadhar rao on Mar 10, 2011 6:56 AM

  • Class variable declaration

    Hello.
    Just looking through some code and I see a class variable declared as so...
    static final MessageDigest digestFunction;
    static { // The digest method is reused between instances to provide higher entropy.
            MessageDigest tmp;
            try {
                tmp = java.security.MessageDigest.getInstance(hashName);
            } catch (NoSuchAlgorithmException e) {
                tmp = null;
            digestFunction = tmp;
        }I have never come accoss a variable being declared in this way and it looks strange. The use of static before the opening brace is strange to me, and just the fact that this is not inside the constructor. Would this code be run after or before code inside the class constuctor?
    Thanks for any help, just a little confused!

    Sir_Dori wrote:
    Ah yes, of course it could not be within the constructor as it is static, sorry.
    So when would the class be loaded? Could this be the first time the ClassName.staticBlockVar is accessed, Most likely, yes. The first time something else uses the class. Classloading in Java is lazy.
    Also, is the code not reevaluated every time it is referenced ?No. Only when the class is loaded (actually, when it's initialized, but usually it boils down to the same thing)
    You can write some simple tests for this, by writing a constructor and a static initializer, then instantiating it twice, for example. Don't be afraid to just play around with code to test assumptions. I find JUnit very handy for experimenting with assumptions.

  • Thread cannot access the class variables.

    Hi
    I have below code snippet : (Only section of which I have copied below)
    public class ProcessAppendAction extends HttpServlet implements Runnable{
         public ProcessAppendAction ()
    MI_OS_APPEND port ;
    protected void doGet(
              HttpServletRequest request,
              HttpServletResponse response)
              throws ServletException, IOException {
              //TODO : Implement
    port =
                        (MI_OS_APPEND) obj.getLogicalPort(
                             "MI_OS_APPENDPort",
                             MI_OS_APPEND.class);
    Thread[] threads = new Thread[noOfThreads];
    ProcessAppendAction run = new ProcessAppendAction(req);
                                            Thread th = new Thread(run);
                                            threads[no] = th;          
                                  threads[no].start();
                                  threads[no].join();
    public ProcessAppendAction(DT_REQUEST_APPEND req) {
              this.requestObj = req;
              // TODO Auto-generated constructor stub
    public void run()
              try
                   DT_RESPONSE res = this.port.MI_OS_APPEND(requestObj);
                                  catch(Exception e)
                                       int ch=0;
                                       ch++;
              }     In above code I am successfully creating an object in line :
    port =
                        (MI_OS_APPEND) obj.getLogicalPort(
                             "MI_OS_APPENDPort",
                             MI_OS_APPEND.class);But when I am trying to access this port variable in run method it is giving null.
    Port in my code is a class variable.
    Is it the case that thread cannot access class variable !!

    money321 wrote:
    ok, I have removed join() from just after start().So that now the Servlet can return before the new Thread has finished. Is this what you want?
    First I did invoked all threads and then in second loop i invoked Join on all threads.I don't understand. Why do you need to join() all the threads since you only start one thread in this request. What am I missing?
    >
    Now, my problem.
    It was solved when I substituted the line
    ProcessAppendAction run = new ProcessAppendAction(req)
    with
    ProcessAppendAction run = new ProcessAppendAction(req,port);Of course. Instance variables in Servlet instances are a no-no so passing the 'port' though an instance variable is just wrong.
    >
    That is passes port alongwith req while creating thread object.
    But still if class variables are not thread safe, then it means if I pass object 1 to thread 1.
    And then try to pass object 2 to thread 2, it might be possibility that object 1 of thread 1 might be replaced by object 2.
    So, thread 1 will get an updated value object 2.Yep - that is why you should not use instance variables in Servlets and why they are not thread safe.
    >
    Which is not what I intend to do...:-)

  • How to create a instance for the method

    it is showing me dump error for the call method
    data: i_tab type /SCMB/DM_ORDER_TAB,
          grid1  TYPE REF TO /SCA/CL_SVORDER .
    CALL METHOD grid1->READ_BY_IDS
      EXPORTING
       IS_CTRL      =
        IV_ORTYPE    = gt_po_detl-ortype
       IV_LOCKFLG   = /SCMB/CL_C_ORDER=>GC_FALSE
       IV_NOADDRESS = /SCMB/CL_C_ORDER=>GC_FALSE
       IV_MAPID     = /SCMB/CL_C_ORDER=>GC_FALSE
       IV_DUEQUAN   = /SCMB/CL_C_ORDER=>GC_FALSE
        IT_ORDERID   = itab_orderid
      IMPORTING
        ET_ORDERS    = i_tab
       ET_PROT      =
    u r attempting to use a null object reference access a component (variable 'GRID!")
    an object reference must point to an object (an instance of  a class ) before it can be used to acess a component either the reference was never set or it was set to null using the clear statement

    sridhar loganathan,
    A ABAP Class is just a definition of fields/variables called attributes and routines (like in standard ABAP forms and functions) called methods. Also you can have events, don't care about before necessary.
    The definition itself is just a blueprint. Nothing exists, nothing can be used before you create an instance for this definition.
    DATA: grid1 TYPE REF TO /SCA/CL_SVORDER creates a 'handler' for ( to be created) instances of the class.
    The statement CREATE OBJECT grid1 creates an instance of the class as defined in the 'blueprint' and assigns the reference to this instance (with all methods, attributes and events) to reference field grid1.
    In 999 of 1000 cases SAP creates just one object of a class. In those cases the definition of classes and uses of object oriented programming is more or less obsolete.
    Anyway: Just keep in mind that you can not uses attributes and methods of the class directly (blueprint!) but only of the instance created.
    An Exception to be noted are so-called Static attributes and methods where an instance is not required. Example ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB gives the character for horizontal tab regardless of platform and char encoding (unicode!). Class ABAP_CHAR_UTILITIES defines static attribute HORIZONTAL_TAB - no instances necessary because this will never change in a given system.
    Hope this sheds some light on it
    Regards,
    Clemens

  • Is CLASS VARIABLE changed?

    I have two classes in same package. I defined a class variable 'no_of_gear' and later changed its value. The changed value
    works in the same class but does not work in sub-class in same package.
    class ClassVar {
         static int no_of_gear = 5;
         public static void main(String[] args) {
              System.out.println(no_of_gear); //Prints 5
              ClassVar cv = new ClassVar();
              System.out.println(cv.no_of_gear); //Prints 5
              cv.no_of_gear = 8;
              System.out.println(cv.no_of_gear); //Prints 8
              System.out.println(no_of_gear); //Prints 8
    }Here is sub-class in same package.
    class ClassVarAcc extends ClassVar {
         public static void main(String[] args) {
              System.out.println(no_of_gear); //Prints 5
              ClassVar cv = new ClassVar();
              System.out.println(cv.no_of_gear); //Prints 5
    }Java Tutorial by SUN reveals that if class variable is changed by one object it is changed for all objects of that class. But, my code does not support the statement. Please, Can you clarify it?

    Yes i do but not to the extent you are pointingto.
    Why can't you just say you don't when you don't?
    Can you answer in details?Look at your super class
    class ClassVar {
    static int no_of_gear = 5;
    public static void main(String[] args) {
         System.out.println(no_of_gear); //Prints 5
         ClassVar cv = new ClassVar();
              System.out.println(cv.no_of_gear); //Prints 5
         cv.no_of_gear = 8;
              System.out.println(cv.no_of_gear); //Prints 8
         System.out.println(no_of_gear); //Prints 8
    }In what method does the value of no_of_gear change?
    Now look at the sub-class. Do you see yourself
    calling this method?OH my dear. It is class variable that can be accessed directly (unlike instance variables) without the need of some method to change its value.
    Here i change it. (Remeber: a copy of instance variable is passed to an instance of some class but no copy of class variable is passed to an instance of that class)
         cv.no_of_gear = 8;
         System.out.println(cv.no_of_gear); //Prints 8
    Here it works fine.
         System.out.println(no_of_gear); //Prints 8
    But, why does not it work in sub-class?

  • Getting all the members (variables, methods AND method bodies) of a java source file

    For a project I want to programmatically get access to the members of java source file (member variables, methods etc) as well as to the source code of those members. My question is what is the best method for this? So far I have found the following methods:
    Use AST's provided by the Java Source API and Java Tree API, as discussed in the following posts:
    http://today.java.net/pub/a/today/2008/04/10/source-code-analysis-using-java-6-compiler-apis.html
    http://weblogs.java.net/blog/timboudreau/archive/2008/02/see_java_code_t.html
    http://netbeans.dzone.com/announcements/new-class-visualization-module
    This has the disadvantage that the classes actually have to be compilable. When I look at the Netbeans Navigator view however, it provides me with a nicely formatted UI list, regardless of the "compilable" state of the class.
    Thus I started looking at how to do this... The answer appears to be through the use of tools such as JavaCC: https://javacc.dev.java.net/
    ANTLR: http://www.antlr.org/
    which are lexers and parsers of source code. However, since the Navigator panel already does this, couldn't I use part of this code to get me the list of variables and methods in a source file? Does the Navigator API help in this regard?
    Another route seems to be through tools such as
    BeautyJ: http://beautyj.berlios.de/
    which run on top of JavaCC if I am correct, and which has the ability to provide a clean view on your java code (or an XML view). However, BeautyJ does not seem to be too actively developed, and is only j2se1.4 compatible.
    I hope someone can shed a light on the best way to go about what I want to achieve. Somebody already doing this?
    (I crossposted on the Netbeans forums too, hope this is OK...)

    I'm currently developing a LaTeX editor(MDI) and I do the same thing, but I don't know what exactly do you need.

  • Assign a value to class variable

    I want to define a class variable in class. And I want all subclasses of that class ot have a different value for that class variable. How can I do that?
    public class BaseClass {
      public static String tableName = "";
    }Now if I have a ClassA and I want to assign a value like this :
    public class ClassA extends BaseClass {
      tableName = "location";
    } I got an error message.
    I can move it in a static initializer block but then it will only work when the class is loaded. In my case its possible i want to get this value without loading the class.
    Ditto if i move it to constructor.
    Any input? Thanks

    Are you saying that if i have 2 classes ClassA and
    ClassB inherited from BaseClass, then both are
    sharing the same copy of 'tableName' staticvariable?
    If yes then I should go with an instance variable.No, I am saying that you can easily declare a
    tablName in A and another tableName in B.
    A.tableName will be shared between all the instances
    s of A. B.tableName will be shared between all the
    instances of B. And BaseClass.tableName is
    irelevant. I think you try to use
    BaseClass.tableName as some kind of template for
    sub-classes, but this does not happen: you need to
    declare tableName again and again in each subclass.
    IThanks for clarifying. Each class needs to have a variable "tableName" and it needs to have one copy of this variable for all of that class's objects. 2 classes will not have the same value of this tableName variable.
    Thats why I was defining it as static variable. And I define it in BaseClass so that I dont have to define it again in each subclass.
    Is there any better way? Thanks

Maybe you are looking for

  • Questions on Weblogic RMI

    Hi           I've a few questions on WL RMI that I couldn't figure out from the           documentation.           Suppose I have a cluster containing Weblogic servers server1 and server2.           Server1 hosts an RMI object o1 that is bind to the

  • How to change the status of material while creating sales order via BDC

    Hai. In BDC while creating sales order( va01 posting ) it is stucking up in middle saying material is new. I.e Sales order (va01) is not  getting created because  of material status is new . I want to create sales order  (va01) even  material status

  • Problem with -hg PKGBUILD after pacman update

    After I updated to pacman 4.1.0, my PKGBUILD for sunflower-hg stopped working for me. For some unknown reason makepkg fails to clone the needed mercurial repo and src directory turns out to be empty at the time of the build. What has gone wrong? Last

  • My nokia n95 gps wont work?

    When i origannally got the phone the maps were coming up. But now since i have downloaded and installed nokia maps nothing is happening. I have nokia map loader and have downloaded the australian map succsesfully but still no maps are coming up on my

  • Double IDocs Generated from SAP

    We create delivery in R/3 using VL01N & subsequently pick & pack changes done with VL02N. Then normally ONE IDOC is generated. Problem. Here 2 IDOC's generated for a single delivery document. How can this happen? pl help. We processed the same data i