javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

I am not familiar with Derby, so I would like someone else to help if they can.

What I could suggest is this:

Usually I use this method: conn=DriverManager.getConnection(dbURL,username, password); Try to use that, and print the values of the variables you are using to see if the dbURL is correct. Maybe the name of the property in the Properties class is not the one the Derby expects.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

At that line something is null:
at model.dao.ConnectDerbyDAO.createTables(ConnectDerbyDAO.java:158)

My guess is the connection. So try to go to that line and print the objects you are using.
Also you need to close the connection, statement in the finally block.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Then try to see what is the value of regusername.

<%
String strSessionUser = session.getAttribute("regusername");
System.out.println("strSessionUser:"+strSessionUser );
if (strSessionUser == null) {
%>
  <jsp:forward page="index.jsp?expmsg=Please login" />
<%
}
<%

Maybe what you have in the catch doesn't execute the way you want it because each browser has small differences in the way they handle javascript. ...maybe

Instead of using javascript, you can use the RequestDispatcher class and write java code that redirects.

But most important check what is the value of strSessionUser when you think you should redirect

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

You set panel to null and then you are trying to use it. Maybe after the null you need to create a new one.

Also use equals method to compare Strings:

if (place.getText().equals(" ")) {

}
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Can you post code on how you redirect?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

You mean display only one element of the array?
You can create an array that has only one element, the element you want to display. But that would make the JList useless since that is not its purpose. Maybe you can change the way you add the JList to the frame, make it a bit wider.
Also if you look at the API there is an example on how to add scrolling to the list.

If you had already thought of that, sorry but that was my thought too.

Another thing would be to make a custom ListModel. Again check the API of the JList

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

The idea is not to get output, since all it does is save to a file.
By the way you have a mistake. This is the correct one:

for (int i = 0; i<data.length; i++){
	        	      for(int j = 0; j<data[B][i][/B].length; j++){
    ....
    }
}

Also try to close the PrinterWriter at the end:

import java.io.*;
import java.util.*;

public class TestingII {
	
	
	public static void main(String[] args){
		int[][] data = {{1,2,3,4},
						{5,6,7,8},
						{4,9,1,0},
						{2,5,8,3}};
		Scanner stdIn = new Scanner(System.in);
		PrintWriter writer;
	 
		try
		{
			System.out.print("Enter a filename: ");
			writer = new PrintWriter(stdIn.nextLine());
			for (int i = 0; i<data.length; i++){
	        	      for(int j = 0; j<data[i].length; j++){
	        		    writer.print(data[i][j] + ",");
	        	      }writer.println();
			}	
		}
		catch (FileNotFoundException e){
			System.out.println("Error: " + e.getMessage());			
		} [B]finally[/B] {
                          try{if (writer!=null) writer.close(); } 
                         catch (Exception e) {System.out.println("Could not close writer");}
                }
	}
}

Also I don't know the API of the PrintWriter but I assume that it takes as argument a String, which the way you have it

kdott commented: thanks for the help! +0
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Check the API of the String class. There is a method that converts the String into an array of chars.
Now loop that array and see if the first element is equal with the last.
The 2nd with the last -1
The 3rd with the last -2
The 4th with the last -3

If you find something that is not equals then return false.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

First of all the last else should be an if. Since you say that animal has to be [1000,2999] then it is possible the else to be executed even if that is not true. If ID is 100 for example. You should also have an if for the invalid IDs or put them all in else-if.

Also this will NEVER be true: (animalID <= 3000 && animalID > 7999) If ID = 4000:
animalID <= 3000: (4000<=3000) FALSE
animalID > 7999: (4000>7999) FALSE

But if you do this: (animalID >= 3000 && animalID <= 7999) If ID = 4000:
animalID <= 3000: TRUE
animalID > 7999: TRUE

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

So far I have this code. How to fix the following:

(a) Error lines in the method isStraightFlush.
(b) How to add printCard and printDeck to my classes. What should I write in the method?
(c) shuffleDeck crashes if the deck has less than 52 cards. What shouild I do here?
(d) In several methods I have this code which crashes sometimes. How do I fix it?

for (int i = 0; i < cards.length - 1; i++) {
counter[cards.getRank ()]++;
}

a) Read the error messages they are pretty clear. You are not calling the methods correctly. Look how you have declared them and call them like that.

b) Do whatever you want. Usually you print their attributes.

public void printCard() {
  System.out.println("Card: "+suit+" "+rank);
}

With printDeck iterate the array and print each of the cards attributes.

d) Array go from 0 to length-1. So this would be correct: for (int i = 0; i <= cards.length - 1; i++) OR better and more commonly used: for (int i = 0; i < cards.length; i++) Also counter is an array with length 13 -> [0-12]. So the getRank: counter[cards[i].getRank ()] should return something between 0 and 12 not 1 and 13.

c) Try to print the values you are passing as parameters and see what happens. Maybe the random number is for some random cases 52 instead of 51.

Also if you are using:
int random = …

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

The class FileReader could look like this
Here I renamed it to MyFileReader to avoid the confusion with the calss FileReader that is in the package java.io

public class MyFileReader {

    public static void main(String args[]) throws Exception {

        FileReader fr = new FileReader("animal.txt");
        BufferedReader br = new BufferedReader(fr);
        String s;
        while ((s = br.readLine()) != null) {
            Animal animal = null;
            //System.out.println(s);
            String[] info = s.split(",");
            int animalID = Integer.parseInt(info[0]);
            String animalType = info[1];
            double weight = Double.parseDouble(info[2]);
            int cageNumber;
            String name;
            String trainer;
            String owner;
            if (info.length == 5) {
                try {
                    //ZooAnimal
                    cageNumber = Integer.parseInt(info[3]);
                    trainer = info[4];
                    animal = new ZooAnimal(animalID, animalType, weight,cageNumber,trainer);
                    System.out.println(((ZooAnimal)animal).toString());
                } catch (Exception e) {
                    //Pet
                    name = info[3];
                    owner = info[4];
                    animal = new Pet(animalID, animalType, weight,name,owner);
                    System.out.println(((Pet)animal).toString());
                }

            } else {
                animal = new Animal(animalID, animalType, weight);
                System.out.println(animal.toString());
            }

        }
        fr.close();
    }
}

it gives the right out put;
sure other solutions are possible

Hope it helps.

Try not to give away ready solution. And if you do try to explain what you did.
In this post you didn't explain anything. You expect the reader to understand your code and if they don't, he has code that works but does not know what it does and why.
That could be more confusing because in the future when they try to do something similar they wouldn't know how to work around that code.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

You must take each line the way you do now and extract the data:
> 3000,Monkey,38.6

3000
Monkey
38.6

Then with that data create an Animal instance and print it.
For that there is the split method:

String s = "3000,Monkey,38.6";
String [] tokens = s.split(",");
// tokens array now has: {"3000", "Monkey", "38.6"};
tokens[0] : Id
tokens[1] : Type
tokens[2] : Weight
// its length is tokens.length = 3

So if the line is:
> 5252,Giraffe,130.3,103,Samuel,
The length of the array would be 5.

Use that to determine what kind of object to create an Animal, or a Pet.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Also if you want that array to be used in another method. Just declare a method that takes as argument an int array and pass it as parameter.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Snice in the inerface it is like this: public void display(ComplexNum a, ComplexNum b) Then the same must be in the class.

public String subtract(ComplexNum a, ComplexNum b){
int x=a.getReal()-b.getReal();
int y=a.getComplex()-b.getComplex();
String yst=y +"i";
System.out.println( '(' +x+ ',' + y + ')');
return ( "(" + x + "," + yst + ")" );
}

But you don't have to worry, because the inerface ComplexNum has all the methods you are using in that method.

I would like to add that those methods (add, multiply, ...) need to be static. That's because they do nothing to the state of the class they are in.
The class ComplexNumb has some attributes real, comb and methods that use them (getReal, setReal, ..)
But the other methods don't use those values, they simply add 2 numbers. So they have nothing to do with the instance itself. In one of those, you add two numbers. What happens in there has nothing to do with the values of real, comb of the class itself. The numbers that take as arguments are irrelevant to the rest of the object.

They could be in a separate class and they don't have to be in the interface:

public interface ComplexNum {

public int getReal();
public int getComplex();

public void setReal(int r);
public void setComplex(int c);
}

MathUtil

public class MathUtil {
   public static String add(ComplexNum a, ComplexNum b) {
      int x=a.getReal()+ b.getReal();
      int y=a.getComplex()+b.getComplex();
     String ys =y + "i" ; …
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Thanks
But somewhere else i got a good answer :
using

UIManager.put("OptionPane.yesButtonText", "yeAh")

for example cause to show "yeAh" instead of "yes" for all JOption panes.
So, this is resolved.
But I dont know how to find all of swing.properties keys, however thats another subject ...

Then why don't look the API of the UIManager class. I did and there is a method: getLookAndFeelDefaults. That method returns a UIDefaults object (look the API) which extends the Hashtable (again from the API of the UIDefaults-look at the definition of the class). So it inherits methods that lets you get all the properties. For that you will need to look the API of Hashtable.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

The code that you written would work, provided that you have a Student. class. Usually first you write the Student class. So in a separate file on its own, create a Student class with any attributes, methods and constructors you want. Then create student instances and put them in the list:

public class Student {
   // attributes
   
   public Student() {

  }

  //  and more
}

Take a look some tutorials about objects

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

And may I add that you need to declare the temp array in the main. Also, I don't know if it is a problem with copying your code, but you have 2 main methods.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Because in the same file, you declare 2 classes:

class threads implements Runnable {
  threads() {

  }

class ThreadStarter {

}
}

You don't need a separate inner class for the main. Just put it in the threads class

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

If you decide how the interface would be written try this and tell me:

public interface ComplexNum {

public int getReal();
public int getComplex();

public void setReal(int r);
public void setComplex(int c);

public String add(ComplexNum a, ComplexNum b);
public String subtract(ComplexNum a, ComplexNum b);
public String multiply(ComplexNum a, ComplexNum b);

public void display(ComplexNum a, ComplexNum b);
}

Also I believe that the last methods: (add, ..., display), should be static. Because you don't use any of the attributes and they do nothing to change or display the state of the instance. They just take objects as parameters and use them.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

The same thing I told you about the display method applies to all:
These method(int i); and method(); are not the same methods.
So you must implement exactly the same method at the class.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

The interface has this method: void display() The class has this method: void display(ComplexNumb a, ComplexNumb b) So you don't implement the void display() method. You just declared another method that happens to have the same name, but it is not the same method.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

If you are talking about the void display() then no you haven't implemented it.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

The shorthand method returns a String. So call it with argument the line given and print what it returns:

String result = shorthand(s);
System.out.println(result);
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Then why did you asked source code. Maybe we misunderstood your intentions, but no one can give you something that costs that much. What exactly do you want?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

There are other loops as well. Not only the for loop. And check the API. How on earth did you came up with this: sc.length . You cannot just call whatever methods you imagine. That is why you have the API. To see which methods each class has.

Scanner sc = new Scanner(System.in);
boolean cont = true;

while (cont) {
   System.out.println("Enter value:");
   String s = sc.nextLine();

   if ("*".equals(s)) {
     cont = false;
  } else {
     // do stuff with the 's'
  }

}
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Are you referring to a commercial telecom billing system that costs tens of thousands of dollars and a group of many people have worked on that for many months?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster
public class Dice {
        
    public static void main(String[] args) {

    // Welcome message.

        System.out.println ("Welcome to The Dice Roller Game!");
        
   // Roll the dice.
    	
    		int die1, die2;
    		int rollcount;
    		rollcount = 0;
		int wins = 0;	

Scanner keyboard = new Scanner(System.in);
int userinput=-1;

		do {
			die1 = (int)(Math.random()*6) + 1;
            die2 = (int)(Math.random()*6) + 1;
            rollcount++;
            if (die1 == die2) {
                  System.out.println("You won in " + rollcount + " rolls.");
                  rollcount = 0;
                 wins++;
                 System.out.println("Would you like to play again?");
                  userinput=keyboard.nextInt();
            } else {
                 System.out.println("You didn't roll pairs.");
                System.out.println("Try Again?");
		userinput=keyboard.nextInt();
            }
		}	while ( userinput==1 );

System.out.println("Wins: "+wins);
	}
}

You can change the above code according to your needs

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

There are 2 Date objects:
the java.util.Date and the java.sql.Date. The sql.Date doesn't have a Date() constructor. Only the util.Date has.

If you need both try:

java.util.Date d = new java.util.Date();
java.sql.Date dout = new java.sql.Date(.....);

check their APIs

Although your whole logic is not the best approach. Don't use servlet, for displaying. Forward an object to a jsp page through the request and do the rendering in that jsp page. Don't put html code in a servlet.

Search for some tutorials

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

post the code you use for editing the single new cell.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

I used those terms at yahoo and got lots of info. I combined them with java:
>mutual exclusion java
>atomicity java
>wait set java

The links seem to have lots of info. I don't know any more in order to help you.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Are you sure you are posting your question to the right forum?
Have you tried searching the net for those terms?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Does the file has to be like that? I mean is it you that decides how the data will be saved?

If you cannot change the way the data are saved then try this:

From what I see you know how to read line by line a file:

while (( line = bf.readLine()) != null)
{
   System.out.println("Line read: "+line);       
}

Create a class Photo like this:

class Photo {

 private String subject = null;
 private String location = null;
 private String date = null;
 private String path = null;

 public Photo() {

 }

// add get/set methods
}

If the file will always have correct data then:
Read until you find the number of photos:

int numOfPh = 0;
Photo [] photos = null;

while () {
 if (line.startsWith("Number of Photos:")) {
     numOfPh = ... ; //get the number.
     photos = new Photo[numOfPh];
 }
}

Then read until you find the line with the "Subject:" . Assuming that the file will always has those 4 attributes with that order then, after you find the line with the "Subject" read the next 4 lines:

int index = 0;
while () {
  if (line.startsWith("Subject")) {
      String subj = line; // get the subject from the line;
      String loc = bf.readLine(); // get the location from the line
      String date = bf.readLine(); // get the date from the line
      String path = bf.readLine(); // get the path from the line

      photos[index] = new Photo();
      // set …
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

(Can i get the class name of Class1 using c)??

BestJewSinceJC's answer was not wrong.

But the answer to the above question, is no. After taking the 'c' instance you cannot programmatic-ally know in which class it was created.
Unless you make some changes.

As BestJewSinceJC said inside method1 you know that you are inside the Class1. So change the Class2 constructor that takes as argument an object. And whenever you create a 'Class2' pass as parameter the object in which Class2 was created. Or better pass the Class of that object.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Ok i changed it, it works thanks......
do you know how or the outline i can use to count prepositions?

What are prepositions?

Anyway, since you have the each line, you can use as "skeleton" the code you have and process the line anyway you want.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

You don't need the StringTokenizer:

BufferedReader br = new BufferedReader(fr);

int numOfVowels = 0;

String line = br.readLine();
while (line!=null) {

  char [] ch = line.toCharArray();  
  // loop the char array. 
  // for each character in the array, if you find a vowel increase the numOfVowels 

  // always the last command to get the next line, before checking again at the begining of the loop if it is not null
  line = br.readLine();
}
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

java.lang.NullPointerException
at javax.swing.plaf.basic.BasicListUI.updateLayoutState(Unknown Source)
at javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(Unknown Source)
at javax.swing.plaf.basic.BasicListUI.getCellBounds(Unknown Source)
at javax.swing.JList.getCellBounds(Unknown Source)
at javax.swing.JList.ensureIndexIsVisible(Unknown Source)
at sun.swing.FilePane.ensureIndexIsVisible(Unknown Source)
at sun.swing.FilePane.doDirectoryChanged(Unknown Source)
at sun.swing.FilePane.propertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at java.awt.Component.firePropertyChange(Unknown Source)
at javax.swing.JFileChooser.setCurrentDirectory(Unknown Source)
at javax.swing.JFileChooser.setSelectedFile(Unknown Source)
at GalleryPanelTest.testGalleryPanel(GalleryPanelTest.java:35)

At line 35 of the file: GalleryPanelTest.java, inside the method testGalleryPanel, you are using something which is null.
Try to print all the objects you are using at that line amd see what is null.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Line 25: System.out.println(object5.mName()); , I doubt that the Month class has a method mName() .
What errors do you get and what are you trying to do?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

It is also could to close what you open. And you also forgot to return the array and increase the index 'i' :) . May I post some similar code?

public class UCTest{

	public String[] run() throws SQLException {
		Connection con = null;
                Statement stmt = null;
                ResultSet res = null;
                String[] test = null;
		try{
			con = new database().getConnection();
			stmt = con.createStatement();

			String sql = "SELECT * FROM test";
			res = stmt.executeQuery(sql);

                        int count = 0;
                        while(res.next()){
                            
                            count++;
                        }
                        
                        res.beforeFirst();
                        int i = 0;
                        test = new String[count];
			while(res.next()){
                            test[i] = res.getString("Q1");
                            //// Continue code from here for obtaining answers

i++;
                        }

                }catch(SQLException e){
                    e.printStackTrace();
                } finally {
                   if (rs!=null) rs.close;
                   if (stmt!=null) stmt.close; 
                   if (con!=null) con.close;
                 }
                 return test;
	}
}

And if you want to return more columns you'd better define a class with attributes the columns and return an array of that object.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Have you looked at the printStackTrace ?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Post some lines of the file

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

count1 is non static. It is an attribute of the MergeSort1 class and must be called the way the non static methods are called:

MergeSort1 marr = new MergeSort1(maxSize);
System.out.println("Number of comparisons: " + marr.count1 );

When you are inside the class MergeSort1 you are ok, because it is a member of that class. But in the main you create an instance of that class, so you need to access the count1 of that class:

MergeSort1 marr1 = new MergeSort1(maxSize);
marr1.count1;

MergeSort1 marr2 = new MergeSort1(maxSize);
marr2.count1;

MergeSort1 marr3 = new MergeSort1(maxSize);
marr3.count1;

Those 3 count1s are different. Each one belongs to their instance and it is not a rule that they will have the same value. For different arrays they will return different results

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

The updateHealth method is of the LittleAlien class, so in the method Caught, you can do this:

public void Caught(LittleAlien aLalien)
{
   aLalien.updateHealth();
}

Also more code would be required. And I don't think that LittleAlien should extend BigAlien, but I could be wrong. Post your requirements as well.

ttboy04 commented: 1 +1
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

When A.jsp first loads the V is null. So you can do this:

<%
String V = request.getParamater("V");
if (V==null) {
%>

<form onsubmit="return validateSelect()"action="Select.jsp" method="get">
<h2>Select:</h2>
<h3>Enter the URL of the publisher you perfer to publish your ads on: </h3> <br/>
<input type="text" name="SUrl" style="width: 250px;" />
<input TYPE="submit" value="Submit"/>
<input type="hidden" name="V"/>
</form>

<%
} else {
.....
}
%>

There is method called: request.forward ,
if I remember; check it out. To send the V value through a url at the second page use:

String V = request.getParamater("V");
String url = "A.jsp";
if (V!=null) url = url + "?V="+V;

Also it is better not to have multiple forms in a jsp and if statements to determine which to display. Have different jsps, and at the second page, depending on the value of V decide which one to load.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

The API is there for you to read it, not learn it by heart.

As long you know how to call methods with the right number and type of arguments and put the return value inside the right type, you are ok.

Of course that doesn't mean that for every single method you need to look at the API. With extensive use some of the methods you learn them. But If you want to do something different, you don't have to remember everything, just where to find the method that you want.

And I don't believe that anyone knows the entire API even if it is the core java. If such person existed, he wouldn't know nothing about programming, because he would have wasted all his time in learning methods by heart instead of using them.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

I am sorry for not reading the entire post. I focused on the code.
...
I think I noticed something that might be the solution. Maybe by the time you read this, you have seen it too, or it is just a typo while you were posting the code:

<select name="[B]lista1[/B]" id="lista1"></select><br/>

String name1 = request.getParameter("[B]list1[/B]");

Try this: String name1 = request.getParameter("[U]lista1[/U]"); Instead of this:" String name1 = request.getParameter("list1"); If this doesn't solve your problem, can you post some more code?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

First of all study some html. The "select" tag misses the "option" tag which is the one that has the "value" attribute. If you look at the tag, you don't give it any value. So of course it displays null since you don't send anything.

http://www.w3schools.com/default.asp

Second don't just call methods and expect them to do whatever you want or think they do. The getParameterValues method returns an array. If you don't know what happens when you print an array, or what are those strange numbers are: "string java lang @ numbers numbers numbers letters numbers" then STOP right now what you are doing and start studying basic java. Because what you just saw was the call of the toString method that was inherited by the Object class. And if you look at the API of the Object class then the toString method prints just that.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

And I already told you what to do. You have declared a constructor (Employee) with 6 arguments and you are not calling it. You are calling it with 3 arguments.
It is very basic. When you have a method with a certain number of arguments, you call that method with the right type and amount of arguments.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

You changed the contructor of the Employee class. So it is normal that you get an error when you try to call the old constructor: super(String, String, String) .
Such contructor with 3 arguments does not exist. The new takes 6 arguments.
So the new is this:

public Employee( String first, String last, String ssn, String date, int month, int day, int year ) {

}

But you are calling this:

public SalariedEmployee( String first, String last, String ssn, 
      double salary )
   {
      [B]super( first, last, ssn );[/B] // pass to Employee constructor
      setWeeklySalary( salary ); // validate and store salary
   }
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

super, calls the constructor of the super class and in this case the Employee class:

public SalariedEmployee( String first, String last, String ssn, ... {
    [U]super( first, last, ssn );[/U]

}

Does the Employee has a constructor that takes as parameters 3 Strings.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

You need to post the line that you get the error. The error messages, indicates the line that it happened as well as the file.