Super class code error..

This is almost giving me an headache LOLOL gosh..
//Super class
public class X {
     private String pp = "xpto";
     public Y refy;
     public X(){}
     public X(String pp){
          this.pp = pp;
          refy = new Y();
     public String getPP(){ return pp; }
     public int p() {
          return Integer.parseInt(refy.testarString());
     public static void main(String[] xxx ){
          X x = new X();
          System.out.print(x.p());
// Extended class
public class Y extends X{
     private String ficheiro;
     public  Y() {}
     public Y(String pp, String ficheiro){
          super(pp);
          this.ficheiro = ficheiro;
     public String testarString() {
          String k = "2";
          return k;
I can't print that "2" inside the main method of the Super class, does anyone could tell me why ?
Message was edited by:
Java__Estudante

It would be helpful in the future if you could post the error you're getting (I'm assuming a NullPointerException)
Take a look at your two contructors:
> public X(){}
     public X(String pp){
          this.pp = pp;
          refy = new Y();
     }And then when you instantiate x, which one you call:
>           X x = new X();
          System.out.print(x.p());See what I'm getting at? Also, using a member variable in your superclass that is an instance of the subclass is a little strange--what is that trying to accomplish?

Similar Messages

  • Super class setClass() error

    I don't understand why I can't set this. Any suggestions?
    (BTW - what's the code to type so my posting look like code and not text?)
    package com.sig.cis217.classes.accts.src;                         //     Create package
    import java.text.NumberFormat;                                        //     Java core packages
    import java.util.Locale;
    public class Account extends Object
                                                                               //     declare constant variables
         private final String     FNLACCTHDR = "The Account of ",
                                       FNLOUTPUTHDR = "\n\n\tBeginning balance\t",
                                       FNLBODYHDR = "\n\nTransaction\tNumber\tAmount\n\n\n";
         protected String      name;                                             //     delcare private variables
         protected double      bal,
                                  trans;
                                                                               // set currency format for output
         NumberFormat moneyFormat = NumberFormat.getCurrencyInstance( Locale.US );
         public Account()
              setAcct( "No Name Entered", 0.0, 0.0 );
         public Account( String n )
              setAcct( n, 0.0, 0.0 );
    //     public Account( String n, double b )
    //          setAcct( n, b, 0.0 );
    //     public Account( String n, double b, double t )
    //          setAcct( n, b, t );
         public void setAcct( String n, double b, double t )
              setAcctName( n );
              //setBegBal( b );
              //setTransAmt( t );
         public void setAcctName()
              name = n;
    //     public void setBegBal()
    //          bal = b;
    //     public void setTransAmt()
    //          trans = t;
         public String getAcctName()
              return name;
    //     public double getBegBal()
    //          return bal;
    //     public double getTransAmt()
    //          return trans;
         public String toString()
              return FNLACCTHDR + name + FNLOUTPUTHDR + moneyFormat.format( bal ) + FNLBODYHDR;

    (BTW - what's the code to type so my posting look like code and not text?)Use:
    ...

  • 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....

  • Error Class Code: 70 on Linux Redhat 6.0

    hi guys!!
    I was installing package by using yum commad on my fresh Linux Red hat 6.0 which i have installed it first time  as follow.
                        $ yum install libaio-devel-0.3.107-10.el6.i686
    But it return error as:
    Loaded plugins: refresh-packagekit, rhnplugin
    This system is not registered with RHN.
    RHN support will be disabled.
    Setting up Install Process
    No package libaio-devel-0.3.107-10.el6.i686 available.
    Error: Nothing to do
    So to reslove this I created account on rhn.redhat.com. I saw under "Registered system" that there was no old system registered. Then I tried to register my system with rhn as follow.
    1. Login as root
    2. rhn_register
        After supplying username and password it returns error like
    Error Class Code: 70
    Error Class Info:
         All available subscriptions for the requested channel have been exhausted.
         Please contact a Red Hat Network Sales associate.
    Explanation:
         An error has occurred while processing your request. If this problem
         persists please enter a bug report at bugzilla.redhat.com.
         If you choose to submit the bug report, please be sure to include
         details of what you were trying to do when this error occurred and
         details on how to reproduce this problem.
    So how can i resolve this error?
    Plz help me....

    As the error states:
    Please contact a Red Hat Network Sales associate.
    If you have a problem with your Red Hat subscription you should contact Red Hat support. It has nothing to do Oracle and I'm afraid no one here will help you with it. RHEL is not a free product beyond its evaluation period.
    Perhaps you might want to take advantage of Oracle Linux as mentioned in your previous discussion at https://forums.oracle.com/thread/2593755
    Here are some more links that may help you to make the right decisions:
    https://linux.oracle.com/switch.html
    https://blogs.oracle.com/linux/entry/migration_made_easy_switch_from
    http://www.oracle-base.com/articles/linux/oracle-linux-frequently-asked-questions.php

  • 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.

  • Calling constructor of super class

    Hello everyone! I'm a student. I hope I can find guidance. Here's the issue:
    Super class: Property
    Sub class: House
    constructor of parent class:
    protected Property(String id, char status, String address,
            String tenet, String landlord, long rent, char freq,
            long amtDue, String date, boolean repair, char tradesman)
            this.id = id;
            this.status = status;
            this.address = address;
            this.tenet = tenet;
            this.landlord = landlord;
            this.rent = rent;
            this.freq = freq;
            this.amtDue = amtDue;
            this.repair = repair;
            this.tradesman = tradesman;
            SimpleDateFormat formatter = new SimpleDateFormat("dd.MM.yy");
            this.dateDue = formatter.parse(date, new ParsePosition(0));
        }the constuctor of the sub class:
    public House(String id, char status, String address,
            String tenet, String landlord, long rent, char freq,
            long amtDue, String dateDue, boolean repair, char tradesman,
            int broom, int proom, int throom, boolean garden,
            boolean garage, boolean heating)
        super(id, status, address, tenet, landlord, rent, freq,
            amtDue, dateDue, repair, tradesman);
        this.broom = broom;
        this.proom = proom;
        this.throom = throom;
        this.garden = garden;
        this.garage = garage;
        this.heating = heating;
        }I'm sure you notice I'm calling the constructor of the Property in House. That;s where the error is when i try to compile either class. This is the error it shows within the House class.
    Object() in java.lang.Object cannot be applied to (java.lang.String,char,java.lang.String,java.lang.String,java.lang.String,long,char,long,java.lang.String,boolean,char)
    Maybe its elementary? Thanks in advance..

    You haven't pasted all the code so I can only guess that the class House does not extend Property class.
    public class House extends Property
      // put the constructor here
    }If the House class does not extend Property (or any other class) it just extends (by default) the Object class, which does not have the constructor of Property class.
    Hope it helps
    Nick

  • A Weird Class Reference Error

    I have a class called Organization class derived from a class called Entity. And the organization class has a transient attribute called localAddresses. After updating the content of an instance of organization class, I get the following error when I want to display the updated instance in the session (web). I don't know why it refers the super class for the attribute localAddresses.
    An error occurred while evaluating custom action attribute "items" with value "${entry.localAddresses}": An error occurred while getting property "localAddresses" from an instance of class com.abc.xyz.domain.Entry (java.lang.Exception: Local code is not set yet)The JSP code works when either creating a new instance of the Organization class and retrieving it from DB. The related JSP code is the followings:
                   <c:forEach var="address" items="${entry.localAddresses}">
                   </c:forEach>The instance is saved into the session.
    Any possible causes?

    organization class has a transient attribute called localAddresses
    The instance is saved into the session. Could these be related in some way shape or form?
    Transient attributes are not saved when the bean is serialized. So if the bean gets serialized/unserialized that attribute would not be available.
    I don't recognise the exception - is it a custom one you have? What is the full stack trace?
    What does your "getLocalAddresses" method look like?

  • Cant seem to get the super class to work

    I created a couple of files using swing and inheritance of java, which is adding "extends" behind the class name.
    eg.
    public class RandomNumber extends RandomGenerator {
    I am able to run it in my system and all the classes linked up without errors. However when I compile the code on another similar system, a error pops up saying "unable to resolve symbol" and points to the name of the super class.
    The system which is running fine had textpad 4.2.2a installed with j2sdk1.4.0_01...winXP.
    The system which is unable to perform had textpad 4.2.2, j2sdk1.4.0_01...win98.
    I have tried reinstalling jdk a couple of times but its the same....is there any other ways to do it?
    Thanks

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    This are the classes that i import. Now I have a RandomGenerator class which goes
    public class RandomGenerator extends JFrame {
    which I have created the class file, then a second file which goes
    public class RandomNumber extends RandomGenerator {
    the first file is alright, but when i compile the second file, the error is "unable to resolve symbol" and points the error to RandomGenerator(), seems like it is unable to locate the class file of RandomGenerator even though both are in the same folder.
    Regards

  • 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

  • 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?).

  • Mashita uj-846 Sense code error

    I was here yesterday with a problem that all disks were rejected by my Super Drive. One response suggested cleaning - duh! why didn't I think of that?. That brought me some improvement. I can now PLAY CD's and DVD's - but recording is still an almost no go.
    I started with Taiyo Yuden DVD-R 8X White Inkjet Hub Printable (which I was led to believe, from several forums, are the best available). These are rejected - period. I cannot get Disc Info using Toast8. They are ejected without being read.
    So I purchased 5 Memorex DVD+RW. One time, I was able to use Toast8 Disk Info. The report came back properly describing the DVD. When I tried to record a movie to it, Toast8 went thru all of the encoding step just fine. From that I presumed that what I had as input was usable. When Toast8 came to the write step, I got the Sense Code error message. Since then, the DVD-RW disks are rejected immediately. In an attempt to find what the error message might mean, I found that it could be a magnitude of problems - a real catch-all, non-descriptive error message.
    So, I thought I would see if the unit would do any writing. I found the Memorex Printable CD-R (52X-700mb-80minutes) that was included with my DVD/CD printer. I took the same movie that I had been trying to do as a DVD with Toast8, and set Toast8 up for a Video CD. It wrote fine. I don't know what I Did in Toast8 to cause an acceleration, but it took a 48 minute clip and compressed it into a bit over 2 minutes. Everything was visible, just fast. It was like a VCR on FF. If everything else was ok, I could learn my way out of that goof.
    So the summary of all that I've tried. My unit seems to be trying to do the write thing, but is being fussy about the media?? Do all of these symptoms ring any bells with anyone - other than the obvious that was expressed in my other quest - forget the Mashita and go to an external? Is there any media that is know to consistently work with the Mashita?

    +My unit seems to be trying to do the write thing, but is being fussy about the media?? Do all of these symptoms ring any bells with anyone - other than the obvious that was expressed in my other quest - forget the Mashita and go to an external? Is there any media that is know to consistently work with the Mashita?+
    The SuperDrive has a well-earned reputation for being fussy about media. And as the unit gets older and has sucked in dirt, this does not get better.
    If you want to stick with using an internal drive, I'd suggest a replacement from OWC.
    http://eshop.macsales.com/shop/mac-mini/superdrive/
    If you want to do the work yourself, it's not too hard once you get the case open. Or OWC can do the upgrade (and any other upgrades at the same time) for $99 plus parts, which includes overnight shipping.
    http://eshop.macsales.com/shop/mac-mini/install
    They will also sell you an external, tray-loading firewire burner -- which would be less fussy about media, and likely more robust and faster.
    http://eshop.macsales.com/shop/firewire/optical-drives/

  • 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.
    ~

  • Generic interface in abstract super class

    hello java folks!
    i have a weird problem with a generics implementation of an interface which is implemented in an abstract class.
    if i extend from this abstract class and try to override the method i get this compiler error:
    cannot directly invoke abstract method...
    but in my abstract super class this method is not implemented as abstract!
    do i have an error in my understanding how to work with generics or is this a bug in javac?
    (note: the message is trown by the eclipse ide, but i think it has someting to do with javac...)
    thanks for every hint!
    greetings daniel
    examples:
    public interface MyInterface <T extends Object> {
       public String testMe(T t);
    public abstract class AbstractSuperClass<T extends AbstractSuperClass> implements MyInterface<T> {
       public String testMe(T o) {
          // do something with o...
          // now we have a String str
          return str;
    public final class SubClass extends AbstractSuperClass<SubClass> {
       @Override
       public String testMe(SubClass o)
          return super.testMe(o);
    }

    Hi Wachtda,
    Firstly, T extends Object is redundant as all classes implicitly extend the Object class.
    Therefore :
    public interface MyInterface <T> {
       public String testMe(T t);
    }Secondly, abstract classes may have both abstract and non-abstract instance methods. Also, two methods, one abstract and one non-abstract, must have a different signature.
    The following example will give a compile error because the methods share the same signature :
    abstract class Test {
         public void sayHello() {
              System.out.println("Hello");
         abstract public void sayHello();
    }Therefore, to make an interface method as abstract would simply block the possibility of implementing it.
    BTW, you can do this :
    abstract class Test {
         public void sayHello() {
              System.out.println("Hello");
         abstract public void sayHello(String name);
    }Finally, there's no bug in javac.

  • Is there any way to access an overridden method of super class?

    class Animals
         void makeNoice(){System.out.println("General noice");}
    class Dog extends Animals
              void makeNoice(){System.out.println("bark");}
    };Is there any way to access the makeNoice() of Animals class from a Dog object
    Dog dog = new Dog();
    Animal animaldog = dog;
    animaldog.makeNoice(); // will always calls Dog's makeNoice() ie the overriden method.
    Is there a way to access the Animals makeNoice() method ? by using cast or super etc?
    Or it is not possible at all?

    Rajeebs wrote:
    Now another question coming in my mind.
    Whether any way to access a method which belong to super class's super class without using any method of class B,
    like super.super.fn() ??Isn't this just the same question again? And won't you again just "solve" it by writing some invokeSuperSuperMethod or other? This flawed design is quickly getting out of hand, isn't it? The question isn't "How can I invoke an arbitrarily deep superclass' method?" but more "Why do I need to invoke a method belonging to a concrete type at all?". If you need to do that, chances are you've misused inheritance.
    To use your initial sample code, in what circumstance would you require that a Dog make anything other than a Dog noise? It makes no sense. Point is, you have an Animal abstraction, and can call makeNoise on any instance of any subclass, and it will make the appropriate noise. By trying to use trickery to force other noises, you're doing something unnatural, and you're also depending on actual specific concrete subclasses. If you're going to go to specific classes and ask them to make their noise, what use is the inheritance? What use it the polymorphism?
    Are we heading into another "I've got a brilliant idea for a [useless language feature|http://forums.sun.com/thread.jspa?threadID=5423706&messageID=10905772#10905772], guys!" thread?

  • Javah problem - super class could not be found !!

    Hi all,
    i have already posted this message but i didn't get enough help to solve my poor situation.
    and this is my problem:
    i got in my project (myProject) MyClass class.
    i wrote in another java class ,in OtherClass.class ,jni function that use MyClass object as parameter to the jni interface, as follow:
    private native int myFunction (MyClass obj); //function in OtherClass
    when i write the javah command line :
    javah -jni OtherClass (in order to create OtherClass.h)
    i always get the following error:
    A required super class myPackage.MyClass could not be found.
    my qoustion is how can i let the javah command line to know about the existence of myPackage.MyClass and how can i create and .h file when i using other class instance as jni function parameter in other class??
    Thanks Sendy.

    Lets define a few terms here.
    Java can be a java virtual machine which is what runs when you type 'java' on the command line. It is also represented by the compiler which runs when you type 'javac'. And in your case it also is represented by 'javah'.
    The class path defines where java finds classes that it needs.
    In older versions of java you had to tell it where to find everything. It couldn't even find java.lang.String unless you told it were it was. Now days you have to tell it where to find stuff that you add (or where 3rd party libraries are.)
    There are two ways to define the class path: a command line option and an environment variable.
    A class path can, currently, have three types of things in it:
    -A path to a zip file
    -A path to a jar file
    -A path
    For example
    -Path to zip file in windows: C:\mystuff\mylib\mystuff.zip
    -Path to zip file in unix: /opt/system/projects/mystuff/mystuff.zip
    -Path to jar file in windows: C:\mystuff\mylib\myjar.jar
    -Path to jar file in unix: /opt/system/projects/mystuff/myjar.jar
    -Path in windows: C:\mystuff\mylib
    -Path in unix: /opt/system/projects/mystuff
    Zip files aren't used as much anymore, but you should at least be aware of them.
    Java uses the class path to look for classes which are stored in files. It does this by translating the class name into a file name. It uses packages as directory names and class names as file names. So in your case it would try to find a class called myPackage.MyClass in a file called myPackage\MyClass.class. It would try to find that in any zip files, jar files, in in any paths that you specified in the class path.
    So java is trying to find myPackage\MyClass.class in your class path. It would try to find that in any zip files, jar files, in in any paths that you specified in the class path.
    Right now your class path is probably just "." which means that if you do the following commands
    cd C:\mystuff
    javah -jni OtherClass
    Then java is going to try to find myPackage.MyClass in the following file
    .\myPackage\MyClass.class
    That, because you 'cd' to C:\mystuff, translates to the following absolute path
    C:\mystuff\myPackage\MyClass.class
    So if java doesn't find that file then it is going to tell you that it can't find the file.
    So where is your file? Let's say it is here.
    C:\work\lib\myPackage\MyClass.class
    So you must tell javah where the root is. Keep in mind that 'myPackage' must be part of the path. That is not optional. The root is the directory above 'myPackage'. So the root is
    C:\work\lib
    So now you have a path that is ready for your class path. So your javah command could look like this
    javah -classpath ".;C:\work\lib" -jni OtherClass
    Or using an environment variable
    set CLASSPATH=.;C:\work\lib
    javah -jni OtherClass
    Keep in mind in the above that class path is a generic term and there can be other ways to define it. For example the Sun command "java" allows you to use "-classpath" or "-cp".
    So does the above help?

Maybe you are looking for

  • Hiding a column used in the custom view!

    Hello! I would like to find out if there is any way to do the following: I have a view based on a table (Configuration Manager - Views).  I specified to display 4 columns to show up in the View, so that we can modify the columns without going into th

  • IDOC Sales process

    Hi ABAPers     I am new to IDOC i want to send sales order to IDOC i created Sales order how we can able to send that to IDOC and tell me the config process also step-by-step with screen shots Regards Ravi

  • Publishing  files in Adobe Captivate

    Hello, My product is actually Adobe Captivate, as the select your product option is not working on your support portal, Im submitting the case under Flash. Please feel free to redirect to the concerned department. I am a technical writer and currentl

  • Matrix + DataTable re-SELECT problem(s)

    Hi, I try to do something like this: ScreenPainter -> Simple form with matrix and DataTable as data source for it. All Matrix columns are bounded by aliases to data source. In the Matrix and DT I have got one DOUBLE (price) field and two DATE fields

  • Timing in Flash CS4 - why is it wrong on playback?

    How come if you put in 30 fps and your movie is 150 frames long, when you play it back in  a browser it's only 3 seconds long? It should be 5 seconds. This has really peeved me for a long time (a few versions ago). I am a print guy trying to learn th