473,397 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Invalid method declaration; return type required error help

hey, i'm new to java and i keep getting the return type required error on this line;

Expand|Select|Wrap|Line Numbers
  1. public dvds(int productNum, String name, int units, double price, String rating) {
The code for the whole class is as follows;

Expand|Select|Wrap|Line Numbers
  1. // extended class
  2. public class dvd extends dvds {
  3.  
  4.     // rating of the DVD
  5.     private String rating;
  6.  
  7.     // constructor
  8.     public dvds(int productNum, String name, int units, double price, String rating) {
  9.         super(productNum,name,units, price);
  10.         this.rating = rating;
  11.     }
  12.  
  13.     // getter
  14.     public String getRating() {
  15.         return rating;
  16.     }
  17.  
  18.  
  19.     // setter
  20.     public void setRating(String rating) {
  21.         this.rating = rating;
  22.     }
  23.  
  24.     // total value with the 5% fee
  25.     public double value() {
  26.         return super.value()*1.05;
  27.     }
  28.  
  29.     public double fee() {
  30.         return super.value()*0.05;
  31.     }
  32.  
  33.     public double valueNoFee() {
  34.         return super.value();
  35.     }
  36.  
  37.     // string
  38.     public String toString() {
  39.         return String.format(" %03d %-10s %3d $%6.2f $%7.2f %8s",
  40.                 super.getproductNum(), super.getName(), super.getUnits(), super.getPrice(), value(), getRating());
  41.     }
  42. }
  43.  
Any help would be greatly appreciated.
Oct 26 '08 #1
1 5413
Found my mistake...nevermind.
Oct 26 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

30
by: Tim Johansson | last post by:
I'm new to C++, and tried to start making a script that will shuffle an array. Can someone please tell me what's wrong? #include <iostream.h> #include <string.h> int main () {...
3
by: Giulio Santorini | last post by:
Hi, I've got a little problem with my C# WinForms test application. I would like to have a ComboBox showing a a visual value and some hidden values. So I build a class able to store thoose...
2
by: melanieab | last post by:
Hi, I kind of got thrown into C# without any real programming experience, so I know this is probably an easy question, but it's driving me crazy. In my Tabs class, as I'm leaving a tabpage, I'm...
2
by: Raj | last post by:
Hi, I was getting an error in my program saying that return keyword must not be followed by an object expression. I was confused first because I was using return statement in a valid "if"...
1
by: Ryan McLean | last post by:
Hi everyone! What is happening is the method: sub_btnSubmitClicked is being executed every time any other object with a Handler is executed. I am trying not to use the withevents and handles...
3
by: Erik H. | last post by:
I have an ASPX page in which I am trying to bind a datagrid to a dataset pulled from Microsoft Access DB using code inline method. For some reason, the compiler is having a problem with 'using'....
9
by: MR | last post by:
I get the following Exception "The data at the root level is invalid. Line 1, position 642" whenever I try to deserialize an incoming SOAP message. The incoming message is formed well and its...
11
by: markryde | last post by:
Hello, Followed here is a simplified code example of something which I try to implement; in essence , I want to assign a value to a return value of a method is C. I know, of course, that in this...
4
by: mattehz | last post by:
Hey there, I am trying to upload old source files and came across these errors: Warning: Invalid argument supplied for foreach() in /home/mattehz/public_html/acssr/trunk/inc_html.php on line 59...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.