method overloading of only  the retun type is not allowed in Java (or in c++ 
for that matter).

ref:  http://java.sun.com/docs/books/tutorial/java/javaOO/methods.html   (see  
'overloading methods')


so you'll need different parameters in order for the method/function to have a 
unique signature to the compilier.



hope that helps.


-Ed Morris
  ----- Original Message ----- 
  From: false 
  To: Free Java Programming Online Training Course by Sang Shin 
  Sent: Friday, September 11, 2009 3:49 PM
  Subject: [java programming] Lab-1022hw


        Hi there,

        I have a setter and getter method to set the character to upper case 
and 
        then a getter method to return the value of the set character.

        I am having a problem with return of the following:
        
-----------------------------------------------------------------------------------------------------------------------
         public byte[] getupdate() throws IOException;
            
         public void setupdate(byte[] b, int off, int len) throws IOException;
        
-----------------------------------------------------------------------------------------------------------------------

        the error is that getupdate is already defined which it is but with an 
int return not an array of byte.  Thank you.


         
          






        --- On Fri, 9/11/09, Zhao Lin <[email protected]> wrote:


          From: Zhao Lin <[email protected]>
          Subject: [java programming] [java programming]
          To: [email protected], 
[email protected]
          Date: Friday, September 11, 2009, 10:28 AM


                Hi Charles Thomas,

                I do again with help from my friend here.

                Difficult to understand this.
                "public void update(byte[] b, int off, int len)"

                "byte[]b" means an array of bytes.  one array element has 8 
bits because we do characters.

                When use "Hello World" this means

                "Hello"  have "len =5" and "off = 0" 

                White Space btw two words I do not understand how it goe into 
array element?

                "World" have parameter "len =5" and "off = 7"

                This is psuedo look of array with correct form but array 
element psuedo. 
                [H]
                [e]
                [l]
                [l]
                [o]
                []
                ...  

                but use unicode like 
                [73]
                [102]
                ....

                so 73 is represented as one byte of data or use 8 bit?  Byte 
mean one char primitive? 

                Each array element hold one char primitive in form of a 8 bit 
unicode (1's and 0's) which I people look as number like 73.

                Hope my confuse is better and not confuse U.  Sorry for my 
write.  


                Thank you.

                Zhao




                --- On Fri, 9/11/09, Charles Thomas <[email protected]> 
wrote:


                  From: Charles Thomas <[email protected]>
                  Subject: [java programming]
                  To: [email protected]
                  Date: Friday, September 11, 2009, 8:12 AM


                  To Zhao Lin:



                  I have been studying Java all summer and feel that I am 
getting pretty good at it.  I have just joined the course so I am behind but 
have read Dietel and Dietel’s book; Java, how to program (all 1500 pages of 
it).  I have written over 200 classes but I’ll tell you I cannot make head nor 
tails of what you have written. 

                   

                  Firstly, there are no pointers in Java, at least using the 
arrow ( -> ).  When you create an instance of a class a reference is returned 
but it is not used the same as pointers in C/C++ 

                   

                  Assume the word like is not in your program so I’ll leave 
that alone..  There is no word and in Java.  And is done with &&.  

                   

                  Java is an Object Oriented language but you have not declared 
any classes.  There are no variable declarations and to tell you the truth I 
cannot even figure out what you are trying to do. 

                   

                  What you asked about the bits, bytes and characters is 
correct. 

                   

                  Your update method declaration is written properly but no 
body and it will have to override the superclass update method. 

                   

                  I am still new to java but I am making progress.  I hope I am 
correct in my assumptions here but do not take it as the gospel.  The one thing 
I am unsure about is the update method.  I am unsure if there is a method with 
this same signature in the superclass, please refer to the online 
documentation.  If not you will have to write this class from scratch.  Update 
is usually used with just a Graphics object as the single parameter to update 
graphics or animations. 

                   

                  If you let me know what your trying to achieve I can probably 
be of more help.  


                  

               
       

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to