Java Compiler Error

Java Compiler Error

I get this error when i compile this Java inheritance OOP. What I'm i doing wrong.

F:\Java\WorkerDemo.java:9: cannot find symbol
symbol : constructor ProductionWorker(java.lang.String)
location: class ProductionWorker
ProductionWorker newProd = new ProductionWorker("Johnsmith");
^
1 error

Tool completed with exit code 1

This is from my codes as below
public class ProductionWorker extends Employee
{
public String Shift;
public double PayRate;


//Default constructor
//Post condition: fname,mName,lName = ""

public ProductionWorker()
{
super();
PayRate = 0.0;
Shift = "";

}

public ProductionWorker(String firstlast, String shift, double rate)
{
super(firstlast);

PayRate = rate;
Shift = shift;
}

//Method to return the first middle last names
//Post condition: The values of fName,mName and lName
//are return as strings

public String toString()
{
String str = super.toString();// + Shift);// + 18.50);
return str;
}

//Method to set fName = first, mName = middle, lName = last
//Post condition: fName,mName,lName = first,middle,last respectively

public double Pay()
{
return (PayRate);

}

//Method to get the fname
//Post condition: fName is return

public void setPayRate( double rate)
{

PayRate = rate;
}

//Method to return the last name
//Post condition: lName is return
public double getPayrate()
{
return PayRate;
}

public void setShift(String shift)
{
Shift = shift;
}

public String getShift()
{
return Shift;
}


}
and Employee class also as follows. The ProductionWorker Extends Employee Class.

public class Employee
{
private String firstlastname;
private String hiredate;
private String empnumber;
private String isValidEmpNum;



//Default constructor
//Post condition: fname,mName,lName = ""

public Employee()
{
empnumber = "";
hiredate = "";
firstlastname = "";

}

public Employee(String firstlast)
{
setName(firstlast);

}

public void setName(String firstlast)
{
firstlastname = firstlast;
}


public String getfirstlastname()
{
return firstlastname;
}

public String toString()
{
return (firstlastname);// + "" + empnumber + " " + hiredate );
}


public void setNumber(String number)
{
empnumber = number;
}

public String getempnumber()
{
return empnumber;
}

public void setDate(String date)
{
hiredate = date;
}

public String gethiredate()
{
return hiredate;
}

public void empvalidation(String isValidEmpNum)
{
if (isValidEmpNum == null)

System.out.println ("Employee Number is invalid");
}

}
View Answers









Related Tutorials/Questions & Answers:
java compiler error
java compiler error  I am trying to compile a simple program which is as follows: public class A { public static void main(String args... as well.But putting class B in different file named B.java compiler complains about
Java Compiler Error - Java Beginners
Java Compiler Error  I get this error when i compile this Java inheritance OOP. What I'm i doing wrong. F:\Java\WorkerDemo.java:9: cannot find..."); ^ 1 error Tool completed
Advertisements
Java Compiler error - Swing AWT
Java Compiler error  Hi, I try to add quartz Lib in my HelloQuartz application. When I run HelloSchedule, I get this error: "Exception in thread... can add Jar File in Java Build Path Library. i get this message : " No entries
Java error cannot find symbol
Whenever a Compiler does not recognize a class name, Java displays an error... the java error cannot find symbol. In this example a class name 'cannot find...;. The compiler did not recognize a variable “z” and displays an error
java compiler
java compiler  how we can convert .java file to a .class file without using javac
Java error cannot find symbol
Java error cannot find symbol       The java error cannot find symbol... show you an error Java error cannot find symbol. Here is the video tutorial
Java error incompatible types
using = = in assignment operator. The Java Compiler show an error... Java error incompatible types       Java Error incompatible types occurred when
Java error
Java error  class WhileLoopMethod{ public static void main(String args[]){ new Hello(); } } class Hello{ int a = 5, b = 88; while(a } //it is giving compile time error .....illegal start
Java error
Java error  class WhileLoopMethod{ public static void main(String args[]){ new Hello(); } } class Hello{ int a = 5, b = 88; while(a } //it is giving compile time error .....illegal start
Java Compiler
Java Compiler       ... to tell you about the Java Compiler which is used to compile the Java program into byte code. The Java program (.java) file is checked for syntax error
Compiler errors in java
Compiler errors in java  Hi, I used GenerateRDF java file. Am getting errors when i run this code. I used command prompt only. getting errors as no package exist. i followed your instructions properly. Please help me out
What is the right compiler for a java beginner?
What is the right compiler for a java beginner?  Hi, Which compiler I should use to compile my Java program? What is the right compiler for a java... and running your Java program. Check the tutorial: What is the right compiler
What is the right compiler for a java beginner?
What is the right compiler for a java beginner?  Hi, Which compiler I should use to compile my Java program? What is the right compiler for a java... and running your Java program. Check the tutorial: What is the right compiler
Java Compiler,Java Compiler Example
Java Compiler      ... Compiler. When we write any program in a text editor like Notepad, we use Java compiler to compile it. A Java Compiler javac is a computer program or set
Java Compiler
Java Compiler       To commence with Java programming, we must know the significance of Java Compiler. When we write any program in a text editor like Notepad, we use Java compiler
Java Compiler
Java Compiler       To commence with Java programming, we must know the significance of Java Compiler. When we write any program in a text editor like Notepad, we use Java compiler
what is the error - Java Beginners
what is the error  What is the compile time error that i am getting... is creating the compile time error such as : - ? CANNOT FIND SYMBOL ? because you have declared variable comment that?s why compiler is not able to read
java compilation error - Java Beginners
java compilation error  I need to know how to correct a compiler error for my program to run. The error I keep getting is unclosed string literal... and this is when my compiler error occurs. Let me know if you need any
Compiling Error - Java Beginners
Compiling Error  cant able to compile java servlet file in the command prompt? WHY? but i can compile normal java file give me answer to fix my... compiler and tomcat. For more information, visit the following links: http
java compilation error - Java Beginners
) { ProductInventory2.addProduct(temp); repaint(); THE COMPILER ERROR BEGINS...java compilation error  Hello, I'm having problems with trying to correct 2 compiler errors. The code I'm having trouble with is listed below
compilation error - Java Beginners
the compiler is referring to, then compile your class with the following: javac
Java Error - Java Beginners
Java Error  Hello Sir ,How i Can solve Following Error Can not find Symbol - in.readLine(); Here Error Display at in  Hi Friend, It seems that you haven't defined the object 'in'.Anyways, Send your code so that we
which package imported by the java compiler by default?
which package imported by the java compiler by default?  which package imported by java by default
runtime error in java
runtime error in java  What is Run time error in Java?   Run time error is a syntax error that during the execution of a program.It hash different types of a program like as Logic error,Fatal Errors,source code,wrong
pointer error java
pointer error java  How to catch null pointer errors in java if the if(value != null) or null
java error - Java Beginners
java error  Hello sir, on compiling any program from command prompt.... But if I want to run that program the fetches me the following error. For example for file: Test.java C:\Program Files\Java\jdk1.6.0_17\bin>javac Test.java
java error - Java Beginners
java error  G:\threading>javac threadmethods.java Note: threadmethods.java uses or overrides a deprecated API. Note: Recompile with -Xlint... been obsoleted. To get the details of your error, compile your class with Xlint
java compilation error - Applet
java compilation error  I am getting compilation error in the following code.: public void paint(Graphics g) { switch(screen...; } } Error is: Illegal start of expression Plz. find why am I getting this error
Java Error - Java Beginners
Java Error  E:\SUSHANT\Core Java\FileHandling\Error>javac... ch= reader.read(); ^ 1 error import java.io....); //System.out.println("Enter characters, 'q' to quit."); try
Java Error - Java Beginners
Java Error  Here Error near Read Method import java.util.*; import java.io.*; public class inputdemo { public static void main(String[] args) throws IOException { String bookname,author; float price; System.out.println
JAVA Annotation Error
JAVA Annotation Error  while compiling simple java program i get annotation error i.e class will only be accepted if annotation processing is explicitly requested..how to solve
java runtime error - JDBC
java runtime error  when i m running my program by using jdk1.6.0 then it is giving the error of classunsupported major.minor version 50.0.to remove... version error 49.0.so, please suggest how will i compensate this problem
java error - Java Beginners
java error  Thanks for providing me the answer for the question... be dereferenced If Programme saved in SortFileData also shows some error Please rectify the errors and provide the coding that run properly Write a Java program
java runtime error - JDBC
java runtime error  when i m running my program using type1 driver it is showing a runtime error of SQLException of unable to create the connection object.please give the solution
error - Java Beginners
Java error handling  How to write a code to handle the errors in Java?  hi all,visit these site mentioned belowhttp://www.ugrad.cs.ubc.ca/~cs211/tutorials/Eclipse/Eclipse_Java_Windows_XP.htmlit will work
JAVA Error - Java Beginners
JAVA Error  i have made my own calculator GUI..and i want the text..."); btnBack.setForeground(red); it send me an error message that goes like this unknown...: http://www.roseindia.net/java/ Thanks.   Hello Just use
error message - Java Beginners
error message  sir, while i m trying to execute my first program(print my name)I get error message like" javac is not recognized as internal...;Hi friend, To compile and run a java program we need to install java
java compilation error - Applet
java compilation error  hi friends the following is the awt front design program error, give me the replay E:\ramesh>javac...://www.roseindia.net/java/example/java/awt/ Thanks
java error - Java Beginners
java error  Dear roseindiamembers, I have checked the registration form for new user to login roseindiamembers forum with different data.It's not working properly .when i am registering as new user in http
Java Error - Java Beginners
Java Error  import java.io.*; import java.lang.*; public class Wrapperdemo { float prin; float rate; int no; float interest; Wrapperdemo() { try{ BufferedReader br = new BufferedReader(new InputStreamReader
java runtime error - JDBC
java runtime error  when i am running my jdbc program using thin driver this error is coming at runtime: Exception in thread "main..., give me the suggesion yo solve this problem  This kind of error due
runtime error - Java Beginners
runtime error  I created a sample java source ,compiled it succesfully using command prompt but when i tried to run i got the folowing error " Exception in thread "main" java.lang.UnsupportedClassVersionError" I have set
Error with PrintDocument - Java Beginners
Error with PrintDocument  Error: StudRec.java:526: printComponent(java.awt.Component) in PrintableDocument cannot be applied.... Note: Recompile with -Xlint:unchecked for details. 1 error
Error - Java Beginners
Error  How to rectify requested resource()not found . HTTp-404 error
java runtime error - JDBC
java runtime error  sir when i m running the jsp connectivity program it is giving the error as follows:' java.lang.NullPointerException at jsp_servlet.__resplogin._jspService(__resplogin.java:237
complier error - Java Beginners
error shows syntax errors like: required : int found : byte Runtime error shows logical errors like: int x=2/0; //this expression causes runtime error Thanks  Hi Friend, Difference: Compile time error shows syntax
compilation error - Java Beginners
this program it is giving an error as integer number is too large.why? and what is the reason?  Hi Friend, In Java there are some specific literal... not in the Hexadecimal or Octal. Here is fraction of Java code example which will help you
to solve the error - Java Beginners
, Your code having error : You not have declare any main method So java.lang.NoSuchMethodError: main error occur and you add this main method...; } } } } } For read more information : http://www.roseindia.net/java/ Thanks
ERROR - Java Beginners
ERROR  Hello Sir i am getting error to this code 1.write a java program to read these strings apple orange banana and display the frist... am getting an error that is StringProgram.java:6: cannot resolve symbol
java struts error - Struts
java struts error   my jsp page is post the problem enter email              ... THINK EVERY THING IS RIGHT BUT THE ERROR IS COMING I TRIED BY GIVING INPUT

Ads