Serializing super class

hi All,
I was working with object serialization and of the condition is that *"if superclass is not serializable then it must have a public default constructor"*.
My question is, how will having a default constructor in the super class will help serialization.
any sort of information in this regard is much appreciated.

codingMonkey wrote:
9th-Stallion wrote:
Thanx for the reply Maaijade.
The question now is that, if no constructor is available in the super class, won't java will creat a default constructor itself, as it does to creat objects of classes that do not have constructors.
ThanxOnly if the super class has no other constructors whatsoever.Which, of course, means that after compilation it already has the default constructor anyway, as that is added by the compiler. ;-)

Similar Messages

  • Error while calling a super class public method in the subclass constructor

    Hi ,
    I have code like this:
    CLASS gacl_applog DEFINITION ABSTRACT.
      PUBLIC SECTION.
        METHODS:
                create_new_a
                   IMPORTING  pf_obj       TYPE balobj_d
                              pf_subobj    TYPE balsubobj
                              pf_extnumber TYPE string
                   EXPORTING  pfx_log_hndl TYPE balloghndl
                   EXCEPTIONS error
    ENDCLASS.
    CLASS gacl_applog IMPLEMENTATION.
      METHOD create_new_a.
        DATA: ls_log TYPE bal_s_log.
      Header aufsetzen
        MOVE pf_extnumber TO ls_log-extnumber.
        ls_log-object     = pf_obj.
        ls_log-subobject  = pf_subobj.
        ls_log-aluser     = sy-uname.
        ls_log-alprog     = sy-repid.
        ls_log-aldate     = sy-datum.
        ls_log-altime     = sy-uzeit.
        ls_log-aldate_del = ls_log-aldate + 1.
        CALL FUNCTION 'BAL_LOG_CREATE'
             EXPORTING
                  i_s_log      = ls_log
             IMPORTING
                  e_log_handle = pfx_log_hndl
             EXCEPTIONS
                  OTHERS       = 1.
        IF ( sy-subrc NE 0 ).
          MESSAGE ID      sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH    sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
                  RAISING error.
        ENDIF.
      ENDMETHOD.
    CLASS gcl_applog_temp DEFINITION INHERITING FROM gacl_applog.
      PUBLIC SECTION.
        DATA: log_hndl   TYPE balloghndl READ-ONLY
            , t_log_hndl TYPE bal_t_logh READ-ONLY
        METHODS: constructor
                   IMPORTING  pf_obj       TYPE balobj_d
                              pf_subobj    TYPE balsubobj
                              pf_extnumber TYPE string
                   EXCEPTIONS error
               , msg_add      REDEFINITION
               , display      REDEFINITION
    ENDCLASS.
    CLASS gcl_applog_temp IMPLEMENTATION.
      METHOD constructor.
        CALL METHOD create_new_a
               EXPORTING  pf_obj       = pf_obj
                          pf_subobj    = pf_subobj
                          pf_extnumber = pf_extnumber
               IMPORTING  pfx_log_hndl = log_hndl.
        IF ( sy-subrc NE 0 ).
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
                  RAISING error.
        ENDIF.
      ENDMETHOD.
    A public method of Super class has been called from the constructor of the sub class. we are getting the syntax error :
    ' In the constructor method, you can only access instance attributes, instance methods, or "ME" after calling the constructor of the superclass…'
    Can you please suggest how to change the code with out affecting the functioanlity.
    Thank you ,
    Lakshmi.

    Hi,
    Call that method by instance of Subclass.   OR
    SUPER-->method.
    Read very useful document
    Constructors
    Constructors are special methods that cannot be called using CALL METHOD. Instead, they are called automatically by the system to set the starting state of a new object or class. There are two types of constructors - instance constructors and static constructors. Constructors are methods with a predefined name. To use them, you must declare them explicitly in the class.
    The instance constructor of a class is the predefined instance method CONSTRUCTOR. You declare it in the public section as follows:
    METHODS CONSTRUCTOR
            IMPORTING.. [VALUE(]<ii>[)] TYPE type [OPTIONAL]..
            EXCEPTIONS.. <ei>.
    and implement it in the implementation section like any other method. The system calls the instance constructor once for each instance of the class, directly after the object has been created in the CREATE OBJECT statement. You can pass the input parameters of the instance constructor and handle its exceptions using the EXPORTING and EXCEPTIONS additions in the CREATE OBJECT statement.
    The static constructor of a class is the predefined static method CLASS_CONSTRUCTOR. You declare it in the public section as follows:
    CLASS-METHODS CLASS_CONSTRUCTOR.
    and implement it in the implementation section like any other method. The static constructor has no parameters. The system calls the static constructor once for each class, before the class is accessed for the first time. The static constructor cannot therefore access the components of its own class.
    Pls. reward if useful....

  • How to get the subclass from a super class( or interface)

    hi,
    I want to get subclass from a super class (or a interface), how to do that? the subclass of a interface means the class implementing the interface.
    for example;
    List ls;
    I want to get the subclass of ls, i.e., LinkedList, Stack, Vector......
    AbstractList al;
    the subclass of al, i.e., ArrayList, Vector.......
    thanks
    Aiwu

    List ls = new ArrayList();Since ls has been declared as a List we can only use List methods
    with it. This is a good thing because we might later want to change
    it to some other sort of List.
    I want to get subclass from a super class (or a interface), how to do
    that?The instance of the subclass declared above did not really come
    from the super class. A class "knows nothing" about its
    subclasses: many sub classes would not even exist at the time
    the class was written.

  • Problem with subclass and super class

    here is the things i wanted to do
    /*Write a method that takes the time as three integer arguments (hours, minutes and seconds),
    and returns the number of seconds since the last time it was twelve o'clock.
    Write a program that uses this method to calculate the amount of time in seconds between two times,
    assuming both are within one twelve hour cycle of a clock.
    here is a class to find the last time closes to 120'clock in sec.
    import java.io.*;
    public class Timer {
         int converter = 60;
         int secinTwelveHour = 43200;
         int converter2 = 12;
    public int timerTime (int hour, int min, int sec){
              int totalSec = 0;
              //Finding the time
              if (hour > 0 && hour <= 24 && min > 0 && min <=60 && sec > 0 && sec <= 60 && hour <= 11){
                   //find last 12 o'Clock
                   hour = converter2 + hour;
                   //change to sec time
                   totalSec = (hour * converter * converter) + (min * converter) + sec;
              }else{     
         if (hour > 0 && hour <= 24 && min > 0 && min <=60 && sec > 0 && sec <= 60 && hour >= 12){
                   //find last 12 o'Clock in sec
                   totalSec = ((hour * converter * converter) + (min * converter) + sec) - secinTwelveHour;
         }else{
              return -1;
    }//End of return -1      
              }//End of first else statment
         return totalSec;     
         }//End of timerTimer
    }//End of Program     
    and here is the super class which uses the class aboved
    import java.io.*;
    public class FindTime {
    public int find2Time (int totalSec1, int totalSec2){
              int timeSec = 0;
              if(Timer.totalSec1 > Timer.totalSec2)
              timeSec = Timer.totalSec1 - Timer.totalSec2;
              else
              timeSec = Timer.totalSec2 - Timer.totalSec1;
         return timeSec;     
         }//End of find2Time
    public static void main( String [] arg){
         // Construct an instance of the Timer class
              Timer timerClass = new Timer();
              // Make a couple of calls of the method
              int totalSec1 = timerClass.timerTime(12, 3, 45);
              int totalSec2 = timerClass.timerTime(14, 23, 60);
              timeSec1 = find2Time (totalSec1, totalSec2)
              // Now print the values we got back
              System.out.println("Last closes Sec to 12 o'clock" + totalSec1);
              System.out.println("Last closes sec to 12 o'clock" + totalSec2);
              System.out.println("Last closes sec to 12 o'clock" + timeSec);
         }//End of main method
    }//End of Program     
    Now i'm having program with the compliing can anyone help me out like tell me what i'm doing wrong and give me a bit of a code so that i can have a push start
    thanks you

    Does this do what you want? It is in two seperate classes.
    import java.io.*;
    public class FindTime {
    public static void main( String [] arg){
    int timeSec = 0;
    // Construct an instance of the Timer class
         Timer timerClass = new Timer();
         // Make a couple of calls of the method
         int totalSec1 = timerClass.timerTime(12, 3, 45);
         int totalSec2 = timerClass.timerTime(14, 23, 60);
         timeSec = java.lang.Math.abs(totalSec1-totalSec2);
         // Now print the values we got back
         System.out.println("Last closes Sec to 12 o'clock " + totalSec1);
         System.out.println("Last closes sec to 12 o'clock " + totalSec2);
         System.out.println("Last closes sec to 12 o'clock " + timeSec);
         }//End of main method
    }//End of Program
    import java.io.*;
    public class Timer {
    int converter = 60;
    int secinTwelveHour = 43200;
    int converter2 = 12;
    public int timerTime (int hour, int min, int sec){
         int totalSec = 0;
         //Finding the time
         if (hour > 0 && hour <= 24 && min > 0 && min <=60 && sec > 0 && sec <= 60 && hour <= 11){
         //find last 12 o'Clock
         hour = converter2 + hour;
         //change to sec time
         totalSec = (hour * converter * converter) + (min * converter) + sec;
         } else {
         if (hour > 0 && hour <= 24 && min > 0 && min <=60 && sec > 0 && sec <= 60 && hour >= 12){
         //find last 12 o'Clock in sec
         totalSec = ((hour * converter * converter) + (min * converter) + sec) - secinTwelveHour;
         } else {
              return -1;
         }//End of return -1
    }//End of first else statment
    return totalSec;
    }//End of timerTimer
    }//End of Program

  • How to inherit super class constructor in the sub class

    I have a class A and class B
    Class B extends Class A {
    // if i use super i can access the super classs variables and methods
    // But how to inherit super class constructor
    }

    You cannot inherit constructors. You need to define all the ones you need in the subclass. You can then call the corresponding superclass constructor. e.g
    public B() {
        super();
    public B(String name) {
        super(name);
    }

  • Calling a method from a super class

    Hello, I'm trying to write a program that will call a method from a super class. This program is the test program, so should i include extends in the class declaration? Also, what code is needed for the call? Just to make things clear the program includes three different types of object classes and one abstract superclass and the test program which is what im having problems with. I try to use the test program to calculate somthing for each of them using the abstract method in the superclass, but its overridden for each of the three object classes. Now to call this function what syntax should I include? the function returns a double. Thanks.

    Well, this sort of depends on how the methods are overridden.
    public class SuperFoo {
      public void foo() {
         //do something;
      public void bar(){
         //do something
    public class SubFoo extends SuperFoo {
       public void foo() {
          //do something different that overrides foo()
       public void baz() {
          bar(); //calls superclass method
          foo(); //calls method in this (sub) class
          super.foo(); //calls method in superclass
    }However, if you have a superclass with an abstract method, then all the subclasses implement that same method with a relevant implementation. Since the parent method is abstract, you can't make a call to it (it contains no implementation, right?).

  • Overwriting a method of a super class in the subclass ???

    Hi,
    can somebody tell me whether it's possible to add a new implementation of a method in the sub class which is inherited from a super class?
    I want to model my program in that way:
    1. I define a super class with some implemented methods.
    2. This class should be inherited in a sub class. One method should be used as it was implemented in the super class but another method should be overwritten in the subclass.
    I know this concept from Java but I couldn't find a way how to do it in ABAP
    Many thanks for any help!
    Best regards,
    Birgit

    hi,
    yeas you can do it,
    Subclass can re-implement  the inherited public and protected methods from superclass.Class C1 contains method METH1(public) and METH2(protected), both of which are modified and re-implemented in  its subclass C2.also you can have ur own methods in subclass.Objects are created out of both classes and the method METH1 for both objects are called.
    Output of the program demonstrates different behaviour for method METH1 of class C1 and C2.
    This demonstrates the theme.
    REPORT YSUBDEL.
    CLASS C1 DEFINITION.
      PUBLIC SECTION.
       METHODS : METH1.
      PROTECTED SECTION.
       METHODS METH2.
      ENDCLASS.
    CLASS C1 IMPLEMENTATION .
      METHOD : METH1.
       WRITE:/5 'I am meth1 in class C1'.
       CALL METHOD METH2.
      ENDMETHOD.
      METHOD : METH2.
       WRITE:/5 ' I am meth2 in class C1 '.
      ENDMETHOD.
    ENDCLASS.
    CLASS C2 DEFINITION INHERITING FROM C1.
    PUBLIC SECTION.
      METHODS : METH1 redefinition,
      meth3.
    PROTECTED SECTION.
      METHODS : METH2 redefinition.
    ENDCLASS.
    CLASS C2 IMPLEMENTATION.
    METHOD METH1.
       WRITE:/5 'I am meth1 in class C2'.
       call method meth2.
    endmethod.
      METHOD : METH2.
      WRITE:/5 ' I am meth2 in class C2 '.
    ENDMETHOD.
    METHOD : METH3.
      WRITE:/5 ' I am own method of class C2'.
    ENDMETHOD.
    endclass.
    START-OF-SELECTION.
      DATA : OREF1 TYPE REF TO C1 ,
             OREF2 TYPE REF TO C2.
      CREATE OBJECT :  OREF1 , OREF2.
      CALL METHOD : OREF1->METH1 ,
                    OREF2->METH1.
    hope it helps,
    regards

  • Calling a particular Method of all subclass from a super class

    hi
    I have a class 'A' which is a super class for 'B' ,'C' , 'D'
    my main method is in the class Main and while on the run i am calling methods of B,C,D form this main class.
    but as the first step of execution i need to call a init method which has been defined in all the sub-classes. and there can be any no of sub-classes and all will have the init method and i have to call the init method for all classes. is this possible to do that in runtime. ie i wil not be knowing the names of sub-classes.
    thanks
    zeta

    Sorry if i had mislead you all.
    I am not instantiating from my super class.
    as mjparme i wanted one controller class to do the
    init method calls
    so i got it working from the link you gave.
    URL url = Launcher.class.getResource(name);
    File directory = new File(url.getFile());
    This way i can get all the classes in that
    in that package
    and from reflection i can get whether it is
    her it is a sub class of the particular super class
    and i can call the init methods by making the init
    methods static
    thanks for the help
    zetaThis is a rather fragile solution.
    If the problem is one of knowing which subclasses exist, I would suggest specifying them explicitly via configuration (system property or properties file or whatever).
    One thing that's not entirely clear to me: Is the init going to be called once for each subclass, or once for each instance of each subclass? It sounds to me like it's once per class, but I want to make sure.

  • Calling the super class method from the subclass

    Hi all,
    I have a question about inheritence and redefinition of methods. Is it possible to call the superclass implementation of a method which is redefined in the subclass in another method of the subclass?There are possbilities like creation of an explicit super class instance or delegating the super class method implementation to another method which is also protected etc. What i mean is, is there a direct way of calling it?We have ,me,   as the reference for the instance we have(which is the subclass instance in this case), is there also a way of pointing the superclass implementation(with super we can reference in the subclass redefinition, my question is if we have such a parameter in other methods of the subclass too)
    Thanks in advance
    Sukru

    Hi,
    The super reference can only be used in redefined methods to call superclass implementation . So probably what you can do is use upcasting and access the required superclass implementation. I can think of only this way...;-)
    Ex data lr_super type ref to cl_superclass
    lr_super = lr_subclass.
    lr_super->method().
    ~Piyush Patil

  • Trying to use super class's methods from an anonymous inner class

    Hi all,
    I have one class with some methods, and a second class which inherits from the first. The second class contains a method which starts up a thread, which is an anonymous inner class. Inside this inner class, I want to call a method from my first class. How can I do this?
    If I just call the method, it will use the second class's version of the method. However, if I use "super," it will try to find that method in the Thread class (it's own super class) and complain.
    Any suggestions?
    Code:
    public class TopClass
         public void doSomething(){
              // do something
    =============================
    public class LowerClass extends TopClass
         // overrides TopClass's doSomething.
         public void doSomething(){
              // do something
         public void testThread(){
              Thread t = new Thread(){
                   public void run(){
                        doSomething();               //fine
                        super.doSomething();          //WRONG: searches class Thread for doSomething...
              t.start();
    }

    Classes frequently call the un-overridden versions of methods from their superclasses. That's that the super keyword is for, if I'm not mistaken.You're not mistaken about the keyword, but you're not calling the superclass method from a subclass. Your anonymous inner class is not a subtype of TopLevel. It's a subtype of Thread.
    Here it is no different, except that I happen to be in a thread at the time.It's vastly different, since you're attempting to call the method from an unrelated class; i.e., Thread.
    I could also be in a button's action listener, for example. It seems natural to me that if I can do it in a method, I should be able to do it within an anonymous inner class which is inside a method.If you were in an button's action listener and needed to call a superclass' implementation of a method overridden in the button, I'd have the same questions about your design. It seems smelly to me.
    ~

  • Weird one..  i can't return a variable from the extended to the super class

    Hey everyone, i hope i'm not annoying you guys :)
    So today's problem is to return a variable (int) from a method of the extended class and print it ont the super class.
    I'm just testing the super class , if it works fine.
    So the extended class ( FileIO) just read the file txt and return the integer or string ( from the txt file)
    I already did a main method to that class and tested it, it works fine.
    So now the problem is to print the integer ( that the extended class gets from the txt. ) inside the Super class. I mean , is the same thing but now im testing the Super class , just have to do the same thing, a super class method calls the extended class method and receive the integer from the txt file.
    i think the problem is when i create the instance of the FileIO object , maybe its constructor ...i don't know.
    The name of the txt file is passed from the super class to the extended class, but i think the error is not from there.
    this.aero_le = new BufferedReader(new FileReader(super.ficheiroleitura_aero()));  //  super calls ficheiroleitura_aero()  and receive the name of the txt file ( e.g "temp.txt")  so i think that is correct.
    here's the code of the Super class public class Aeroporto {
         private String filereader_voo = "temporary.txt";
         private String filereader_aero = "temp.txt";
         private String siglaAero = "";
         public FileIO file;
         public Aeroporto(){};
         public Aeroporto(String filereader_voo, String filereader_aero) throws IOException{
              this.filereader_voo = filereader_voo;
              this.filereader_aero =filereader_aero;     
              file = new FileIO();
         public String siglaAero() {
              return siglaAero; }
         public String filereader_aero(){
              return filereader_aero;
    public int nrLines() throws IOException{   // it was supose to retunr the number of lines ( integer) from the txt file .
              return Integer.parseInt(file.lerLinhaN(1,1));
    // main() {
    Aeroporto a = new Aeroporto();
              int v = a.nrLines();
              System.out.print(v);
    // ***********************************************************+
    // Extended Class
    public class FileIO extends Aeroporto{
         private String ficheiroescrita;
         private PrintWriter vooescreve, aeroescreve ;
         private BufferedReader voo_le, aero_read;
         public FileIO(){}
         public FileIO(String filereader_voo, String filereader_aero, String ficheiroescrita) throws IOException {
              super(filereader_voo, filereader_aero);
              this.ficheiroescrita = ficheiroescrita;
              //If file does not exists , create one.
              try{
                   this.aero_read = new BufferedReader(new FileReader(super.filereader_aero()));
                   aero_read.close();
              catch(IOException ex){
                   this.aeroescreve = new PrintWriter(new FileWriter(ficheiroescrita));
                   aeroescreve.close();
    public String lerLinhaN(int line, int column) throws IOException{  // this method works fine , i already tested this class.
              this.aero_read = new BufferedReader(new FileReader(super.filereader_aero()));
              for(int i = 0; i != line-1; ++i) aero_read.readLine();
              String linha = aero_read.readLine();
              String [] words = linha.split(" ");
              return words[column-1];
    Maybe the error is that i use to test the Super class a default contructor on both classes... i don't know where the error is, i also did two small classes ( super and another that extends ) and get the string "Hello" from the super and print it inside the extended..and it works, that's why i think the error is when i call the extended class .. need help.
    thanks.

    Ok,
    This one might actually work... atleast it compiles.import java.io.BufferedReader;
    import java.io.FileReader;
    import java.io.File;
    import java.io.PrintWriter;
    import java.io.FileWriter;
    import java.io.IOException;
    public abstract class FileIO {
         public static boolean CreateOutputFileIfNotExists(
              String outputFilename //the name of the file to ensure exists.
         ) throws IOException
              final String functionName = "FileIO.CreateOutputFileIfNotExists";
              boolean retVal = false;
              //If the output file does does not exist then create it.
              //post condition: output file exists or an IOException has been thrown.
              BufferedReader infile = null;
              try{
                   infile = new BufferedReader(new FileReader(outputFilename));
                   retVal = true;
              } catch(IOException ex) {
                   PrintWriter outfile = null;
                   try {
                        outfile = new PrintWriter(new FileWriter(outputFilename));
                        retVal = true;
                   } catch(IOException ex2){
                        throw new IOException(functionName + ": cannot create output file " + outputFilename, ex2);
                   } finally {
                        outfile.close();
                        if (outfile.checkError()) {
                             throw new IOException(functionName + ": error on output stream " + outputFilename);
              } finally {
                   try {
                        infile.close();
                   } catch(IOException ex){
                        throw new IOException(functionName + ": cannot close output file " + outputFilename, ex);
              return(retVal);
         public static String readLine(
                   String  inputFilename //the name of the file to read.
              , int     lineNumber    //1 based number of the line to read from.
         ) throws IOException
              final String functionName = "FileIO.readLine";
              String outputLine = null;
              // reads the numbered "lineNumber" from "inputFilename".
              BufferedReader infile = null;
              try {
                   infile = new BufferedReader(new FileReader(new File(inputFilename)));
                   for(int i=1; i<lineNumber; ++i) infile.readLine();
                   outputLine = infile.readLine();
              } catch(IOException ex){
                   throw new IOException(functionName + ": cannot read input file " + inputFilename, ex);
              } finally {
                   try {
                        infile.close();
                   } catch(IOException ex){
                        throw new IOException(functionName + ": cannot close input file " + inputFilename, ex);
              return(outputLine);
         public static String readWord(
                   String inputFilename  //the name of the file to read.
              , int lineNumber        //1 based number of the line to read from.
              , int wordNumber        //0 based number of the word to read.
         ) throws IOException
              final String functionName = "FileIO.readWord";
              String outputWord = null;
              // reads the numbered space-seperated "wordNumber" from the numbered "lineNumber" of "inputFilename"
              try {
                   String[] words = FileIO.readLine(inputFilename, lineNumber).split(" ");
                   if (wordNumber>0 && wordNumber<words.length) outputWord = words[wordNumber-1];
              } catch(IOException ex){
                   throw new IOException(functionName + ": cannot read input file " + inputFilename, ex);
              return(outputWord);
    }Design notes... FileIO is a generic helper class... there is nothing specific to Airports, flights, or any other "domain" specific stuff in it... so it's re-usable... you can keep it and reuse it on other projects, or even share it with your friends.
    So... The airport class will just call the static methods on FileIO like this    ....
        int lineNumber=1;
        int wordNumber=1;
        String airportCode = FileIO.readWord(airportsFilename, lineNumber, wordNumber);
        ....How's that?
    corlettk: my now mandatory edit.

  • Invoke super class constructor of super class' parent class

    I would like to invoke a constructor of a super class that is the parent of the direct super class. For instance:
    class C extends class B, and class B extends class A.
    From class C, is it possible to invoke class A's constructor without first invoking class B constructor?
    Something like super.A() ??
    Thanks.
    Joe

    try this,
    abstract class GrandParent
          private Object pObj = null;
          protected Via via = new Via();
          protected class Via
             public Object doMethod1( Object obj )
                pObj = obj;
                return "GrandParent m1: " + pObj;
             public Object doMethod2( Object obj )
                pObj = obj;
                return "GrandParent m2: " + pObj;
             public Object get()
                return "gp get: " + pObj;
          public abstract Object doMethod1( Object obj );
          public abstract Object doMethod2( Object obj );
          public abstract Object get();
    class Parent extends GrandParent
          private Object pObj = null;
          public Object doMethod1( Object obj )
          pObj = obj;
          return "Parent m1: " + pObj;
          public Object doMethod2( Object obj )
          pObj = obj;
          return "Parent m2: " + pObj;
          public Object get()
          return "p get: " + pObj;
    public class GPMethod extends Parent
          public static void main( String[] args )
          GrandParent gp = new Parent();
          System.out.println( gp.doMethod1( "calling parent" ) );
          System.out.println( gp.doMethod2( "calling parent m2" ) );
          System.out.println( gp.get() );
          System.out.println( "" );
          System.out.println( gp.via.doMethod1( "calling via to GP" ) );
          System.out.println( gp.via.doMethod2( "calling via to GP m2" ) );
          System.out.println( gp.via.get() );
    }

  • RT Network Shared Variable and Visa Serial Instr class

    Hi,
    I'm using Labview 2009 SP1 with the RT module. I've had no problems creating a RT Target application and a Host PC application which are interconnected using Network Shared Variables, until I came to the COM ports fitted to the RT Target (PXI Embedded Controller and 2 x 4 port COM cards).
    I can configure and use the COM ports in the RT Target application providing I use constants to define which COM port to use, i.e. VISA OPEN function accepts hardcoded "COM2" , (VISA Serial Instr class).
    But I want to pass the COM Port resource name from my host application. 
    Is there a suitable Network Shared Variable I can create ? or how do I change the string value (COM Port name) of the VISA Serial Instr class variable in the RT Target application ?
    thanks,
    Gary.

    Hi there Gary,
    Thanks fot the post. I think I have found something that may be if use to yourself.
    http://labviewwiki.org/Functional_global_variable
    This is the functional global variable.
    Take a look at it and let me know what you think!
    Many thanks,
    Liam A.
    National Instruments
    Applications Engineer

  • Is it possible to override super class constructor?

    Is it possible to override super class constructor form subclass?

    However, you can achieve do something that looks similar to overriding.
    class Parent {
      Parent(int i, String s) {
        // do stuff
    class Child extends Parent {
      Child(int i, String s) {
        super(i, s);
        // do Child stuff here
    new Parent(1, "abc");
    new Child(2, "xyz");Although that's not overriding, it sort of looks similar. Is this what you were talking about?

  • Even i call this() paramerterised constuctor in my class, Is super class su

    Even i call this() paramerterised constuctor in my class, Is super class super() parameter less constuctor invokes?
    I have excuted the following program. And result will be as follows:
    Grandparent() constructor
    Parent 25 constructor
    Parent() constructor
    Child() constructor
    The program is below:
    class ConstructorChain {
    public static void main(String[] args) {
    Child c = new Child();
    class Child extends Parent {
    Child() {
    System.out.println("Child() constructor");
    class Parent extends Grandparent {
    Parent() {
    this(25);
    System.out.println("Parent() constructor");
    Parent(int x) {
    System.out.println("Parent(" + x + ") constructor");
    class Grandparent {
    Grandparent() {
    System.out.println("Grandparent() constructor");
    for this my excepected answer is
    Parent 25 constructor
    Parent() constructor
    Child() constructor
    because in parent class i defined this() constructor so, as my undersatnd is it never call Grand Parent Constructor as it is default parameterless constructor.
    please Advise me
    Aruna

    You can't initialize a class without it's super classes constructor being run. So even if you call another constructor (of the same class), the parent classes constructor will still be called.

Maybe you are looking for

  • How to use iTunes on a central PC with my iPad and AppleTV-2010?

    Hi! I have an Apple TV (new model), two iPads and a central Windows PC running iTunes. I would like to be able to buy movies for that Windows-iTunes installation with my iPad or directly on my AppleTV. Since the latter does not seem possible (you can

  • Screen sharing without Port 5900?

    I have a Mac Pro (desktop) on Lion connected to a router and internet via Cat 5 Ethernet. I have a Mac BOOK Pro on Snow Leopard which I often get online wireless, in our home, but in other rooms. I would like to use Screen Sharing to control the Mac

  • Dispatcher emergency shutdown after instance started

    Hi, I am getting the below error while starting SAP instance: ***LOG Q0I=> NiIBindSocket: bind (126: Cannot assign requested address) [nixxi.cpp 3227] ERROR => NiIBindSocket: SiBind failed for hdl 0 / sock 8     (SI_EADDR_NAVAIL/126; I4; DG; 127.0.0.

  • DS application object type

    Hi Experts, I would have a question.We wanted to make the Object type changeable on Acceptence system therefore we could create on acceptance an Design studio application to try if it runs on netweaver.but I could not find the object type for DS appl

  • Xerox Phaser 3200MFP

    I have a Xerox Phaser 3200MFP attached to a Windows XP Machine. It is shared as a network printer, and my Windows PCs can print to it without any issues. However, my iMac continues to have issues. I have one of the following issues, depending on whic