Class Expected error - HELP

Hi I've been workin on a project, and it seems something is wrong with this code... i honestly cannot figure it out...
here it is :
Uses the following methods:
public static boolean areEquivalent (String word1, String word2)
This method reutrns true or false depending on whether the two input arguments hae equal numbers of A's, B's, and C's (in any order.) You may assume that each string contains only these lowercase characters, in any order or quantity. For example, areEquivalent("abcbca","ccbbaa... ) would return true, because each input string contains 2 as, 2 bs, and 2cs.
this is the code i have so far:
public static boolean areEquivalent(String word1, String word2)
int count = 0;
String line;
for ( int i = 0; i<char.length; i++)
saasd
if count = as + word 2
true
else count = bs + word 2
true
else count = cs + word 2
true
else as==bs==cs
return true
}

Hi,
May I know what is your actual code?
And what error did you get?
thanks
daniel

Similar Messages

  • .class expected error

    I am consistently recieving an error message that says ".class expected" on the "Easter date = new Easter (int year);" line every time i try to compile my tester class. Can anyone help me figure out the problem? Here is my tester/driver class:
    * Tester Class
    * Ben Mathews
    * September 13th, 2009
    public class EasterTester
    public static void main (String [ ] arg)
    Easter date = new Easter (int year );
    date.calculate ();
    }// end main
    }// end Easter

    When you post code, click on "CODE" to generate code tags and paste your code between the tags. Then it will look like this, which will help you get help. /*
    Tester Class
    Ben Mathews
    September 13th, 2009
    public class EasterTester
         public static void main (String [ ] arg)
              Easter date = new Easter (int year );
              date.calculate ();
         }// end main
    }// end Easter When you define a constructor (or a method) with a parameter, you have to tell the compiler what type that parameter is, for example //a constructor example
    public Easter(int year) But, when you use a constructor (or method) with a parameter, you just put in the value or variable, for example int year = 1999;
    Easter date = new Easter (year);

  • '.class' expected Error when trying to pass an Array

    In the below method I am trying to return an array. The compiler gives me one error: '.class' expected. I am not sure if I am writing the 'return' statement correctly and not really sure of another way to code it. Below is a portion of the code and I can post all of it if need be but the other methods seem to be fine.
    import java.util.Scanner;
    public class LibraryUserAccount
    Scanner input=new Scanner(System.in);
    private final int MAX_BOOKS_ALLOWED;
    private int checkedOutBookCounter;
    private long accountNumber;
    private String socialSecurityNumber, name, address;
    private final long isbnNumbers[];
    //constructor
    public LibraryUserAccount(long accountNumber, int maxBooksAllowed)
         this.accountNumber = 0;
         MAX_BOOKS_ALLOWED = maxBooksAllowed;
    //returns the array isbnNumbers[]
    public long getCheckedOutBooksISBNNumbers()
         return isbnNumbers[];
    The error displayed as:
    LibraryUserAccount.java:111: '.class' expected
         return isbnNumbers[];
    ^
    1 error
    Thanks in advance for the help.

    Rewriting the method as:
    public long[] getCheckedOutBooksISBNNumbers()
    return isbnNumbers;
    ... has fixed that particular compiler error. Thanks jverd. I appreciate the help.
    On a separate note I am having trouble with initializing the array. What I am trying to do is initialize an array of a size equal to a value passed to the class. Example being:
    //variables
    private final int MAX_BOOKS_ALLOWED;
    private long accountNumber;
    private final long[] isbnNumbers;
    //constructor method
    public LibraryUserAccount(long accountNumber, int maxBooksAllowed)
    this.accountNumber = 0;
    MAX_BOOKS_ALLOWED = maxBooksAllowed;
    long[] isbnNumbers = new long[MAX_BOOKS_ALLOWED];
    My goal is to set the size of isbnNumbers[] to the value of MAX_BOOKS_ALLOWED. I've tried a couple of different ways to initialize the array (the latest listed above) but the compiler doesn't like what I have done. Thanks again.

  • .class expected error when compiling

    Ive been getting this frustrating error when compiling. My program is essentially supposed to add the values in two matrixes and return a new matrix using the added values
    Heres my code:
       public Matrix add(Matrix comp)
            int[][] temp = new int[this.numRows()][this.numCols()];
            for (int a = 0; a < comp.numRows(); a++) {
                for (int b = 0; b < comp.numCols(); b++) {
                    temp[a] = this.myCells[a][b] + comp.getVal(a, b);
    Matrix addedMatrix = new Matrix(temp[][]);
    return addedMatrix;
    heres the constructor for Matrix object:
      public Matrix(int[][] mat)
            int[][] myCells = new int[mat.length][mat[0].length];
            for (int i = 0; i < mat.length; i++) {
                for (int j = 0; j < mat[0].length; j++) {
                    myCells[i][j] = mat[i][j];
        }getVal, numRows, and numCols are all helper methods that just return values.
    The error is '.class' expected in the line which says Matrix addedMatrix = new Matrix(temp[][]); I checked for extra brackets but there dont seem to be any.
    Any help would be appreciated. Thanks.

    I think you just needMatrix addedMatrix = new Matrix(temp);

  • '.class' expected compiler error

    Here is my code:
    import java.util.*;
    public class LetCount
      public static final int NUMCHARS = 27; //You define
    // int addr(char ch) returns the equivalent integer address for the letter
    // given in ch, 'A' returns 1, 'Z' returns 26 and all other letters return
    // their corresponding position as well.
      public static int addr(char ch)
        return (int) ch - (int) 'A' + 1;
    // Required method definitions for (1) analyzing each character to update
    // the appropriate count; (2) determining most frequent letter;
    // (3) determining least frequent letter; and (4) printing final results
    // should be defined here.
      public static char getCharValue(int index)
        char character;
        int intValueOfA = Character.getNumericValue('A');
        for (index = 1; index <= NUMCHARS; index++)
          int intValueOfChar = intValueOfA + index-1;
          character = (char) intValueOfChar;
        return character;
      public static void countLetters(int count[], String line)
        for (int lineIndex = 0; lineIndex < line.length(); lineIndex++)
          char letter = line.charAt(lineIndex);
          int arrayIndex = addr(letter);
          count[arrayIndex] = count[arrayIndex] + 1;
      public static char findMostFrequent (int [] count)
         int biggestCount = 0;
         int biggestCountIndex = 0;
        for (int arrayIndex = 1; arrayIndex <= NUMCHARS; arrayIndex++)
          if (count[arrayIndex] > biggestCount)
            biggestCount = count[arrayIndex];
            biggestCountIndex = arrayIndex;
        return getCharValue(biggestCountIndex);
      public static char findLeastFrequent(int [] count)
         int smallestCount = 0;
         int smallestCountIndex = 0;
         for (int arrayIndex = 1; arrayIndex <= NUMCHARS; arrayIndex++)
           if (count[arrayIndex] < smallestCount)
             smallestCount = count[arrayIndex];
             smallestCountIndex = arrayIndex;
         return getCharValue(smallestCountIndex);
      public static void printResults(int [] count)
         for (int arrayIndex = 1; arrayIndex <= NUMCHARS; arrayIndex++)
          System.out.println(getCharValue(arrayIndex) + " occurred " + count[arrayIndex] + " times.");
         System.out.println();
         System.out.println("Most frequent letter = " + findMostFrequent(count[]));
         System.out.println("Least frequent letter = " + findLeastFrequent(count[]));
      public static void main(String[] args)
        Scanner keyboard = new Scanner(System.in);  // for reading input
        int[] count = new int [NUMCHARS]; // count of characters
        String line;      // holds input line   
        // Other declarations as needed
        //initializes all elements of count[] array to 0
        for(int i=0; i<NUMCHARS; i++)
          count=0;
    // Method calls and other statements to complete problem solution go here
    while (keyboard.hasNext())
    line = keyboard.nextLine();
    System.out.println(line);
    countLetters(count[], line);
    printResults();
    }The error from the compiler occurs at the following lines:System.out.println("Most frequent letter = " + findMostFrequent(count[]));System.out.println("Least frequent letter = " + findLeastFrequent(count[]));countLetters(count[], line);Please help!  How do I change these lines so that the "'.class' expected" error is solved?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Thanks! Now I just have a run time error:
    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -32
         at LetCount.countLetters(LetCount.java:51)
         at LetCount.main(LetCount.java:118)
    Lines 51 and 118 are these respectively:
    count[arrayIndex] = count[arrayIndex] + 1;In the countLetters method
    countLetters(count, line); At the bottom of main

  • Class, interface, or enum expected error

    import java.awt.Graphics;
    import java.awt.BorderLayout;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.Icon;
    import javax.swing.ImageIcon;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    public class InventoryFinal
    //main method begins execution of java application
    public static void main(final String args[])
    int i; // varialbe for looping
    double total = 0; // variable for total inventory
    final int dispProd = 0; // variable for actionEvents
    // Instantiate a product object
    final ProductAdd[] nwProduct = new ProductAdd[5];
    // Instantiate objects for the array
    for (i=0; i<5; i++)
    nwProduct[0] = new ProductAdd("CD", 10, 18, 12.00, "Jewel Case");
    nwProduct[1] = new ProductAdd("Blue Ray", 9, 20, 25.00, "HD");
    nwProduct[2] = new ProductAdd("Game", 8, 30, 40.00, "Game Case");
    nwProduct[3] = new ProductAdd("iPod", 7, 40, 50.00, "Box");
    nwProduct[4] = new ProductAdd("DVD", 6, 15, 15.00, "DVD Case");
    for (i=0; i<5; i++)
    total += nwProduct.length; // calculate total inventory cost
    final JButton firstBtn = new JButton("First"); // first button
    final JButton prevBtn = new JButton("Previous"); // previous button
    final JButton nextBtn = new JButton("Next"); // next button
    final JButton lastBtn = new JButton("Last"); // last button
    final JButton AddBtn = new JButton("Add"); // Add button
    final JButton DeleteBtn = new JButton("Delete"); // Delete button
    final JButton ModifyBtn = new JButton("Modify"); // Modify button
    final JButton SaveBtn = new JButton("Save"); // Save button
    final JButton SearchBtn = new JButton("Search"); // Search button
    final JLabel label; // logo
    final JTextArea textArea; // text area for product list
    final JPanel buttonJPanel; // panel to hold buttons
    //JLabel constructor for logo
    Icon logo = new ImageIcon("C:/logo.jpg"); // load logo
    label = new JLabel(logo); // create logo label
    label.setToolTipText("Company Logo"); // create tooltip
    buttonJPanel = new MyJPanel(); // set up panel
    buttonJPanel.setLayout( new GridLayout(1, 4)); //set layout
    // add buttons to buttonPanel
    buttonJPanel.add(firstBtn);
    buttonJPanel.add(prevBtn);
    buttonJPanel.add(nextBtn);
    buttonJPanel.add(lastBtn);
    buttonJPanel.add(AddBtn);
    buttonJPanel.add(DeleteBtn);
    buttonJPanel.add(ModifyBtn);
    buttonJPanel.add(SaveBtn);
    buttonJPanel.add(SearchBtn);
    textArea = new JTextArea(nwProduct[3]+"\n"); // create textArea for product display
    // add total inventory value to GUI
    textArea.append("/nTotal value of Inventory "+new java.text.DecimalFormat("$0.00").format(total)+"\n\n");
    textArea.setEditable(false); // make text uneditable in main display
    JFrame invFrame = new JFrame(); // create JFrame container
    invFrame.setLayout(new BorderLayout()); // set layout
    invFrame.getContentPane().add(new JScrollPane(textArea), BorderLayout.CENTER); // add textArea to JFrame
    invFrame.getContentPane().add(buttonJPanel, BorderLayout.SOUTH); // add buttons to JFrame
    invFrame.getContentPane().add(label, BorderLayout.NORTH); // add logo to JFrame
    invFrame.setTitle("CD & DVD Inventory"); // set JFrame title
    invFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // termination command
    //invFrame.pack();
    invFrame.setSize(600, 600); // set size of JPanel
    invFrame.setLocationRelativeTo(null); // set screen location
    invFrame.setVisible(true); // display window
    // assign actionListener and actionEvent for each button
    firstBtn.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent ae)
    textArea.setText(nwProduct[0]+"\n");
    } // end firstBtn actionEvent
    }); // end firstBtn actionListener
    textArea.setText(nwProduct[4]+"n");
    prevBtn.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent ae)
    textArea.setText(nwProduct[4]+"\n");
    } // end prevBtn actionEvent
    }); // end prevBtn actionListener
    textArea.setText(nwProduct[4]+"n");
    nextBtn.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent ae)
    textArea.setText(nwProduct[2]+"\n");
    } // end nextBtn actionEvent
    }); // end nextBtn actionListener
    textArea.setText(nwProduct[4]+"n");
    lastBtn.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent ae)
    textArea.setText(nwProduct[3]+"\n");
    } // end lastBtn actionEvent
    }); // end lastBtn actionListener
    textArea.setText(nwProduct[4]+"n");// assign actionListener and actionEvent for each button
    AddBtn.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent ae)
    textArea.setText(nwProduct[0]+"\n");
    } // end AddBtn actionEvent
    }); // end AddBtn actionListener
    textArea.setText(nwProduct[4]+"n");
    // assign actionListener and actionEvent for each button
    DeleteBtn.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent ae)
    textArea.setText(nwProduct[0]+"\n");
    } // end DeleteBtn actionEvent
    }); // end DeleteBtn actionListener
    textArea.setText(nwProduct[4]+"n");
    // assign actionListener and actionEvent for each button
    ModifyBtn.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent ae)
    textArea.setText(nwProduct[0]+"\n");
    } // end ModifyBtn actionEvent
    }); // end ModifyBtn actionListener
    textArea.setText(nwProduct[4]+"n");
    // assign actionListener and actionEvent for each button
    SaveBtn.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent ae)
    textArea.setText(nwProduct[0]+"\n");
    } // end SaveBtn actionEvent
    }); // end SaveBtn actionListener
    textArea.setText(nwProduct[4]+"n");
    // assign actionListener and actionEvent for each button
    SearchBtn.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent ae)
    textArea.setText(nwProduct[0]+"\n");
    } // end SearchBtn actionEvent
    }); // end SearchBtn actionListener
    textArea.setText(nwProduct[4]+"n");
    // prevBtn.addActionListener(new ActionListener()
    // public void actionPerformed(ActionEvent ae)
    // dispProd = (nwProduct.length+dispProd-1) % nwProduct.length;
    // textArea.setText(nwProduct.display(dispProd)+"\n");
    // } // end prevBtn actionEvent
    // }); // end prevBtn actionListener
    } // end main
    } // end class Inventory4
    class Product
    protected String prodName; // name of product
    protected int itmNumber; // item number
    protected int units; // number of units
    protected double price; // price of each unit
    protected double value; // value of total units
    public Product(String name, int number, int unit, double each) // Constructor for class Product
    prodName = name;
    itmNumber = number;
    units = unit;
    price = each;
    } // end constructor
    public void setProdName(String name) // method to set product name
    prodName = name;
    public String getProdName() // method to get product name
    return prodName;
    public void setItmNumber(int number) // method to set item number
    itmNumber = number;
    public int getItmNumber() // method to get item number
    return itmNumber;
    public void setUnits(int unit) // method to set number of units
    units = unit;
    public int getUnits() // method to get number of units
    return units;
    public void setPrice(double each) // method to set price
    price = each;
    public double getPrice() // method to get price
    return price;
    public double calcValue() // method to set value
    return units * price;
    } // end class Product
    class ProductAdd extends Product
    private String feature; // variable for added feature
    public ProductAdd(String name, int number, int unit, double each, String addFeat)
    // call to superclass Product constructor
    super(name, number, unit, each);
    feature = addFeat;
    }// end constructor
    public void setFeature(String addFeat) // method to set added feature
    feature = addFeat;
    public String getFeature() // method to get added feature
    return feature;
    public double calcValueRstk() // method to set value and add restock fee
    return units * price * 0.10;
    public String toString()
    return String.format("Product: %s\nItem Number: %d\nIn Stock: %d\nPrice: $%.2f\nType: %s\nTotal Value of Stock: $%.2f\nRestock Cost: $%.2f\n\n",
    getProdName(), getItmNumber(), getUnits(), getPrice(), getFeature(), calcValue(), calcValueRstk());
    } // end class ProductAdd
    class MyJPanel extends JPanel
    //private static Random generator = new Random();
    private ImageIcon picture; //image to be displayed
    // load image
    public MyJPanel()
    picture = new ImageIcon("mypicture.png"); // set icon
    } // end MyJPanel constructor
    // display imageIcon on panel
    public void paintComponent( Graphics g )
    super.paintComponent( g );
    picture.paintIcon( this, g, 0, 0 ); // display icon
    } // end method paintComponent
    // return image dimensions
    //public Dimension getPreferredSize()
    // return new Dimension ( picture.getIconWidth(),
    //picture.getIconHeight() );
    } // end method getPreferredSize
    } // end class MyJPanel
    import java.io.File;
    import java.io.IOException;
    public class FileAccessDemo
    public static void main( String[] args ) throws IOException
    // declare variables
    String formatStr = "%s exists in %s? %b\n\n";
    // processing and output
    File file1 = new File( "studentScores.txt" ); // create a File object
    System.out.printf
    (formatStr, file1.getName(), file1.getAbsolutePath(), file1.exists());
    // processing and output
    File folder1 = new File( "c:/personnel/" ); // create a File object
    folder1.mkdir(); // make a directory
    File file2 = new File( "/personnel/faculty.txt" );
    file2.createNewFile(); // create a new file
    System.out.printf
    ( formatStr, file2.getName(), file2.getAbsolutePath(), file2.exists() );
    // processing and output
    file2.delete(); // delete a file, but not the directory
    System.out.printf
    ( formatStr, file2.getName(), file2.getAbsolutePath(), file2.exists() );
    } // end main
    } // end class
    I need help in resolving this error.
    Thanks

    That code isn't where your error is. Here's the errors I get compiling your code:
    H:\java>javac InventoryFinal.java
    InventoryFinal.java:78: ')' expected
    textArea.append("/nTotal value of Inventory "new java.text.DecimalFormat("$0.00").format(total)"\n\n
                                                 ^
    InventoryFinal.java:78: ';' expected
    textArea.append("/nTotal value of Inventory "new java.text.DecimalFormat("$0.00").format(total)"\n\n
                                                                                                   ^
    InventoryFinal.java:340: class, interface, or enum expected
    import java.io.File;
    ^
    InventoryFinal.java:341: class, interface, or enum expected
    import java.io.IOException;
    ^
    4 errorsThe last two errors are on your import statements, which can't be in the middle of a source file. The first two are on this line:
    textArea.append("/nTotal value of Inventory "new java.text.DecimalFormat("$0.00").format(total)"\n\n");Which certainly isn't a legal line of Java code. If you want to connect multiple Strings you need to use the "+" operator.

  • Compiling Error... Found: Class Expected: Value

    Hello, I am writing a GUI with a "join file" feature.
    So far, I load my files (multiple files enabled):
    private void loadFile()
                 JFileChooser fc = new JFileChooser();
                  fc.setMultiSelectionEnabled(true);
                int returnVal = fc.showOpenDialog(MyFrame.this);
                   if (returnVal == JFileChooser.APPROVE_OPTION)
                       File[] files = fc.getSelectedFiles();
           }I join them by adding them into a vector (not sure if there's a better way?):
    public void joinFiles(File[] files)
                   Vector v = new Vector();
                   for (int i = 0; i<files.length; i++)
                       String fileName = new String(files.toString());
                   String line;
                        try
                             BufferedReader in = new BufferedReader(new FileReader(fileName));
                             if ( !in.ready() ) throw new IOException();
                                  while ( (line = in.readLine() ) != null)
                   v.add(line);
                        in.close();
                        catch (IOException e)
                        System.out.println(e);
    Then, as I have a GUI, I have menu item actions set up as follows:
    public void actionPerformed(ActionEvent e){
              if(e.getSource() == load){
                   loadFile();
              if(e.getSource() == join){
                   joinFiles(File[] files);
              }This generates the error:
    fileManipulator.java:93: '.class' expected
    joinFiles(File[] files);
    ^
    fileManipulator.java:93: ')' expected
    joinFiles(File[] files);
    ^
    fileManipulator.java:93: unexpected type
    required: value
    found : class
    joinFiles(File[] files);
    ^
    Help me please!!

    public class FileStuff {
        File [] fileArray;  //Declare as instance variable.
    private void loadFile()
        JFileChooser fc = new JFileChooser();
        fc.setMultiSelectionEnabled(true);
        int returnVal = fc.showOpenDialog(MyFrame.this);
        if (returnVal == JFileChooser.APPROVE_OPTION)
            //files IS NOT ACCESSIBLE OUTSIDE THIS "if" statement.
            File[] files = fc.getSelectedFiles();      // DELETE THIS
            fileArray = fc.getSelectedFiles();    // ADD THIS !!!!!!!
    public void joinFiles(File [] files)
    {  .. no change ..}
    public void actionPerformed(ActionEvent e)
    {  .. no change to "loadFile" part ..;
       if (e.getSource() = join)
          joinFiles(fileArray);
    }

  • "class or interface expected error"

    hi,
    i have these two classes that am using and when i try and compile them i get a class or interface expected error.
    i have looked at previous posts and checked that i have the right number of closed brackets.
    anyone any ideas?
    import java.io.*;
    import java.net.*;
    public class BookingServer {
    public static void main(String[] args) throws IOException {
    ServerSocket serverSocket = null;
         Socket mysocket = null;
    try {
    serverSocket = new ServerSocket(4444);
    } catch (IOException e) {
    System.err.println("Could not listen on port: 4444.");
    System.exit(1);
    Socket clientSocket = null;
    try {
    clientSocket = serverSocket.accept();
    } catch (IOException e) {
    System.err.println("Accept failed.");
    System.exit(1);
    PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true);
    BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
    String inputLine, outputLine;
    BookingProtocol bp = new BookingProtocol();
    outputLine = bp.processInput(null);
    out.println(outputLine);
    while ((inputLine = in.readLine()) != null) {
    out.println(inputLine);
    outputLine = bp.processInput(inputLine);
    out.println(outputLine);
    if (outputLine.equals("BYE"))
    break;
    out.close();
    in.close();
    clientSocket.close();
    serverSocket.close();
    *****************PROTOCOL***********************
    import java.io.*;
    import java.net.*;
    public class BookingProtocol {
    private static final int WAITING = 0;
    private static final int SENTLOGON = 1;
    private static final int SENTSEATREQ = 2;
    private static final int SENTSTATUSREQ = 3;
    private static final String LOGONPROMPT = "LOGON";
    private static final String SEATPROMPT = "SEAT";
    private static final String STATUSPROMPT = "STATUS";
    private static final String BYEPROMPT = "BYE";
    private int state = WAITING;
    public String processInput(String theInput) {
    String theOutput = null;
    if (state == WAITING) {
    theOutput = LOGONPROMPT;
    state = SENTLOGON;
    } else if (state == SENTLOGON) {
    theOutput = SEATPROMPT;
    state = SENTSEATREQ;
    } else if (state == SENTSEATREQ) {
    theOutput = STATUSPROMPT;
    state = SENTSTATUSREQ;
    } else if (state == SENTSTATUSREQ) {
    theOutput = BYEPROMPT;
    state = WAITING;
    return theOutput;
    in.close();
    clientSocket.close();
    serverSocket.close();

    you have too many }-brackets, the finalin.close();
    clientSocket.close();
    serverSocket.close();
    }is not inside any class

  • When calling method error .class expected

    First the method I'm calling.
    public void ExeSqlStmt(String sqlStmt, String columnNames[], String connectString, String userName, String password,int numColumns)
    This compiles clean. The code that calls the method is giving me fits with expecting .class, expecting ), can not resolve symble and unexpected type.
    The offending line is near the bottom of the code.
    Thanks,
    -Rob
    package jdba;
    * Execute the sql statement
    // java imports
    import java.util.Vector;
    import java.awt.event.*;
    import java.awt.Toolkit;
    import java.awt.Container;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import javax.swing.JScrollPane;
    import javax.swing.ScrollPaneConstants;
    import javax.swing.JTable;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    // sql imports
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.sql.PreparedStatement;
    import java.sql.Connection;
    import java.sql.DriverManager;
    public class SqlUtil extends JPanel
      Connection conn;  // database connection object
      Statement stmt;   // statement object
      ResultSet rslt;   // result set object
      // create someplace to put dat
      Vector data;     //    = new Vector();
      Vector columns;  //    = new Vector();
      Vector colHeads; //    = new Vector();     
      public SqlUtil()
        // setup panel
        JPanel sqlPanel = new JPanel(false);
        sqlPanel.setLayout(new BorderLayout());
        setBackground(Color.white);
        setForeground(Color.black);
      public void ExeSqlStmt(String sqlStmt, String columnNames[], String connectString, String userName, String password,int numColumns)
        data     = new Vector();
        columns  = new Vector();
        colHeads = new Vector();
        try
          // connect to database
          DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
          Connection conn = DriverManager.getConnection(connectString, userName, password);
          // select data into object
          stmt = conn.createStatement();
          rslt = stmt.executeQuery(sqlStmt);
          while (rslt.next())
            columns = new Vector();
            for ( int i=0; i<numColumns; i++ )
              colHeads.addElement(columnNames); // column heads
    columns.addElement(rslt.getObject(i+1)); // get the Object at i+1
    } // end for
    data.addElement(columns);
    // create the table
    JTable table = new JTable(data,colHeads);
    // add table to scroll pane
    int v = ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
    int h = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
    JScrollPane jsp = new JScrollPane(table,v,h);
    // Add scroll pane to content pane
    add(jsp, BorderLayout.CENTER);
    // close the result set and close the statement
    rslt.close();
    stmt.close();
    } catch (SQLException ex)
    String msg = "SQL error: "+ex.toString();
    } catch (Exception ex)
    String msg = "Error: "+ex.toString();
    } // end constructor
    } // end SqlUtil class
    // then we have the code that is calling and getting the errors
    package jdba;
    // java imports
    import java.util.Vector;
    import java.awt.event.*;
    import java.awt.Toolkit;
    import java.awt.Container;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import javax.swing.JScrollPane;
    import javax.swing.ScrollPaneConstants;
    import javax.swing.JTable;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    // sql imports
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.sql.PreparedStatement;
    import java.sql.Connection;
    import java.sql.DriverManager;
    // rollback contention
    public class RollbackContention extends JPanel
    Connection conn; // database connection object
    Statement stmt; // statement object
    ResultSet rslt; // result set object
    //private vars
    private String userName = "[cut]";
    private String password = "[cut]";
    private String sid = "rob";
    private String port = "1521";
    private String server = "[cut]";
    private String connectString = "jdbc:oracle:thin:@"+server+":"+port+":"+sid;
    private int numCols = 3;
    private String sqlStmt = null;
    private String prompt = null;
    private String colNames[] = {"name","waits","gets"};
    // constructor
    public RollbackContention()
    SqlUtil exeStmt = new SqlUtil();
    sqlStmt = "select name, waits, gets";
    sqlStmt = sqlStmt + " from v$rollstat, v$rollname";
    sqlStmt = sqlStmt + " where v$rollstat.usn = v$rollname.usn";
    // here is the offending line.
    exeStmt.exeSqlStmt(sqlStmt, colNames[], connectString, userName, password, 3);
    // loop through and display the rollback segments

    In your call your referencing the array as colNames[] - it should be colNames (no []'s )
    exeStmt.exeSqlStmt(sqlStmt, colNames, connectString, userName, password, 3);

  • Syntax error on keyword "void"; "interface", "class" expected

    When migrating my application for Visual-Age to Web-Sphere 5.1
    The following error occurred:
    Syntax error on keyword "void"; "interface", "class" expected
    for the code:
    * ejbLoad method comment
    * @exception javax.ejb.EJBException The exception description.
    public void ejbLoad() throws javax.ejb.EJBException{
         _initLinks();
    }Thanking you in an advance

    I had missed a closing breacket '}'

  • HT1338 tried to update 10.7.4 to 10.7.5 get un expected error at cleanup....have tried several times with no success..after failed try mail will not open because the mail is now incompatible with 10.7.4......HELP

    tried to update 10.7.4 to 10.7.5 get un expected error at cleanup....have tried several times with no success..after failed try mail will not open because the mail is now incompatible with 10.7.4......HELP

    2009 MacBook Pro eh? It looks like your hard drive has failed. Three years is pretty standard. Often, then only hint you have is catastrophic failure.
    If you put the old hard drive into an external enclosure or similar device, you may still be able to migrate your data from it. Just because it won't boot doesn't mean you can't still read from it. Still, I wouldn't keep trying it. As long as you are buying a new hard drive, may as well get sometime to use with Time Machine too.

  • "  ')' expected error..........

    i have defined a function, and the compiler is giving me "')' expected " error...
    here is my code
    package ab;
    import java.io.*;
    import java.util.*;
    import com.db4o.Db4o;
    import com.db4o.ObjectContainer;
    import com.db4o.ObjectSet;
    public class Test3 extends Util {
      public static void main(String[] args) {
         ObjectContainer db=Db4o.openFile(Util.DB4OFILENAME);
        try {
          BufferedReader in = new BufferedReader(new InputStreamReader(System.in));//USER INPUT KEYWORDS
              String the_query = in.readLine();     // READING KEYWORDS
         String[] arr = the_query.split (" ");     // SPLITTING USER KEYWORDS AND STORING IN ARRAY
              //****************************************************************************************ERROR LINE
               func(String p)                   
                       key ab = new key(arr[k]);
                        db.set(ab);
                        System.out.println(arr[k] + " is stored with 1st condition");
                        System.out.println("arr [k] is" + k+ " str[l] is" + l);
         // FETCHING DATA FROM DATABASE
         key proto = new key(null);
         ObjectSet result = db.get(proto);
         LinkedList ll2 = new LinkedList();
         while(result.hasNext()) {
         ll2.add(result.next());
         //System.out.println("retrieved linked list is" +ll2);
         String s = String.valueOf(ll2);
         int m = s.length()-2;
         String sub = s.substring(1,m);
         String [] str = sub.split(",");     // SPLITTING THE KEYWORDS
         int j = str.length;
         int g=0,h=0;
         String temp;
         h = str[0].indexOf('/');          // REMOVING THE "/" TO SEPERATE KEYWORD FROM HYPERLINK AND WEIGHT
         str[0]=str[0].substring(0,h);
         System.out.println("str[]0 is  "+ str[0]);
         for(int i=1; i<j;i++)
         g = str.indexOf('/');               // REMOVING THE "/" TO SEPERATE KEYWORD FROM HYPERLING AND WEIGHT
         str[i]=str[i].substring(1,g);
         System.out.println("str[]" i " is " + str[i]);
    //STORING DATA INTO DATABASE
    int l=0;
    int t = arr.length;
    System.out.println("arr[] length is " + t);
    System.out.println("str[] length is j" + j);
    for (int k=0; k < t; k++)
         {     l=0;
              for(l=0;l<=j;l++)
                   key(arr[k]);
              if(l+1> j)          // CHECKING IF AT THE END OF ARRAY
                        key ab = new key(arr[k]);
                        db.set(ab);
                        System.out.println(arr[k] + " is stored with 1st condition");
                        System.out.println("arr [k] is" + k+ " str[l] is" + l);
              else if((arr[k].equals(str[l]))) {          // CHECKING IF THE TWO STRINGS MATCHES OR NOT
                        System.out.println("arr [k] is" + k+ " str[l] is" + l);
                        System.out.println("Comparing " + arr[k] + "//////////" + str[l]);
                        System.out.println(arr[k]+ " STRING ALREADY PRESENT");
                        System.out.println(" 3rd condition");
                        k++;
                        l= -1;
                        System.out.println("due to 3rd condition now arr [k] is" + k+ " str[l] is" + l);
                   else          // NOT DOING ANYTHING
                        System.out.println("not doing anything");
                        System.out.println("arr [k] is" + k+ " str[l] is" + l);
                        System.out.println("Comparing " + arr[k] + "//////////" + str[l]);
              /* BufferedReader in2 = new BufferedReader(new InputStreamReader(System.in));//USER INPUT HYPERLINK
    BufferedReader in3 = new BufferedReader(new InputStreamReader(System.in));//USER INPUT WEIGHT
                   String hyp = in.readLine();     // READING HYPERLINKS
              String weight1 = in.readLine(); //READING WEIGHT
              int weight = Integer.parseInt(weight1);
              for(int c=0;c<t;c++)
              hyp h1 = new hyp(arr[c],weight);
                   ab.sethyper(h1);
                   db.set(ab);
    in.close();
    //in2.close();
    //in3.close();
    } catch (IOException ioe)
    { ioe.printStackTrace();
         db.close(); }
    and the error is .....C:\Documents and Settings\Sumit\Desktop>javac ab/Test3.java
    ab/Test3.java:22: ')' expected
    func(String p)
    ^
    1 error

    cotton.m wrote:
    cotton.m wrote:
    ping.sumit wrote:
    thanks abillcons!.... i got itGot what exactly?
    Because that won't fix the multitude of problems you have that I listed...Because to be honest with you ping it's pretty annoying that I took the time to look at your code in depth, which Bill
    did not do, and list all the problems you have there and you just want to pretend that adding a return type to a
    method signature in the middle of another method fixes this problem. Certainly a missing return type is a problem in
    a method signature, but when the "method" in question is in the midst of another method and uses variables local
    to the other method, never mind a slew of other variables that are never declared anywhere... well it's not really the
    only problem and certainly fixing it did not make you "get" it. Whatever "it" may be.
    What a waste of time it was helping you. I won't make that mistake again to be sure.Yes you did do more work than I. But I answered his direct and immediate question. I had no intention of stopping there if and when the pgm still did not work. I answered the immediate question, then others went on to add greater depth. It's always a disappointment when one does not seem to receive due credit - and we've all been there. Thats partly why I tried to bring the OP's attention back to my post as well, because it seemed that's what was occurring there too.
    But I also see that many times folks get stuck on a point they are trying to solve and become frustrated to the point of distraction at times - so I think it's best to cut them some slack.
    There has been a real rash of posters that don't come through either with dukes, thanks or even acknowledgments lately ... I hope this OP will not be one of them - I don't see that that is the case thus far.

  • Java '.class' expected, simple but im not seeing it

    I'm working on a project right now and need to list 3 parellel arrays. This is what my compiler error looks like.
    '.class' expected ')' expected
    It's really bugging be, so here are the two methods.
    This is the code that my info is being sent to. This method is in a class named ListPets
    public void listPets(String[] name, double[] price, int[] quanity)
              for(int i = 0; i<name.length; i++)
                   output+="\n"+name[i]+"       "+price[i]+"          "+quanity;
    this is what is being sent to it
    This code is in a class called MainGui
    I also have this little bit at the top.
    ListPets panList = new ListPets();
         public void actionPerformed(ActionEvent ae)
         panList.listPets(petname[], petprice[], petquanity[]);
    }I feel like im over looking somthing, but i cant find it. Any help on this would be nice, thanks,

    panList.listPets(petname[], petprice[] , petquanity[]);You are trying to call a method in the line of code above. So you should only include the variable names, like thispanList.listPets(petname, petprice, petquanity);Some feedback on your design: It looks like you have (at least) 3 arrays whose contents relate to each other. That is, petname[2] is a pet type's name, petprice[2] is the same pet type's price and petquantity[2] is the same pet type's quantity. In Java, you should not use "parallel arrays" to associate the contents of arrays. Instead, you should have a class - that's the whole idea of object oriented programming.

  • Object expected error

    i have written a jsp with other jsp included inside it.
    i am accessing the javascript function present in the outer jsp by the inner jsp <href: javascript........> tag . i am getting object expected error of javascript. any suggestions plz.
    thanks

    its a very big files. i dont think i can paste.. anyways i try . TY
    included jsp
    <%--
    --%>
    <%@ page language="java" import="java.lang.*,java.util.*" %>
    <%@ page buffer = "32kb" %>
    <%@ page import="com.wolterskluwer.atlas.crn.CRNSearcherConst"%>
    <%@ page import="com.wolterskluwer.eip.crn.PortalHelper" %>
    <%@ page import="com.wolterskluwer.eip.crn.MonitorManager" %>
    <%@ page import="com.wolterskluwer.eip.crn.TrackerSort" %>
    <%@ page import="com.wolterskluwer.eip.common.tools.log.Log" %>
    <%@ taglib uri="documentProvider.tld" prefix="dp" %>
    <%@ taglib uri="documentCache.tld" prefix="dc" %>
    <%@ taglib uri="diag.tld" prefix="diag" %>
    <%@ taglib uri="oscache.tld" prefix="oscache" %>
    <jsp:useBean id="userProfile" type="com.wolterskluwer.eip.crn.beans.UserProfile" scope="session" />
    <%
         MonitorManager monMan;
         monMan = (MonitorManager) request.getAttribute("monMan");
    %>
    <%-- define link for help page --%>
    <%
    StringBuffer mycrn_helplink = new StringBuffer(64);
    mycrn_helplink.append("javascript:reSetTimerTop(),displayPopupWindow('" + PortalHelper.getContextWebHelpURL("Publications-search.htm") + "'," + (String)application.getAttribute(CRNSearcherConst.APPLICATION.HELPPAGES_DIMENSIONS) + ")");
    //     check if it is content viewer header,
    //     which is a litte bit diferent then other crn headers
    boolean isContentViewerHeader = false;      
    if(request.getParameter("contentViewerHeader") != null &&
      request.getParameter("contentViewerHeader").compareTo("true") == 0){
         isContentViewerHeader = true;    
    %>
              <!-- TOP MATTER -->
              <DIV id="top-matter">
                   <DIV class="top-left-col">
                        <jsp:include page="../siteid.jsp" />
                   </DIV>
                   <DIV class="top-middle-col">
                       <jsp:include page="headermiddlecol.jsp" />                        
                   </DIV>
                   <% if (!isContentViewerHeader){ %>                    
                        <jsp:include page="../ssouserprofileproductaccess.jsp" />
                   <% } %>     
                   <DIV id=search-strip>
                        <% if (!(request.getParameter("doNotShowSearchStrip") != null && request.getParameter("doNotShowSearchStrip").compareTo("true") == 0)){ %>
                      <DIV class=left-col>
    <%-- --%>                       
                  <% Log.debug("crn_mainheader.jsp: before using cache tag"); %>
              <% Log.debug("crn_mainheader.jsp: key=[request.cachekey_userid]; request.cachekey_userid=[" + request.getAttribute("cachekey_userid") + "]"); %>
              <% String key = "CrnMainHeader"+userProfile.getUserId()+request.getAttribute("ignoreaccessrights");%>
              <% Set keyList = (Set) application.getAttribute("CacheKeyList");
                   if(keyList!=null) {
                        keyList.add(key);
                        application.setAttribute("CacheKeyList", keyList);
              %>
              <oscache:cache key="<%=key%>" scope="application" groups="<%=userProfile.getUserId()%>" refresh="<%=PortalHelper.getWebCacheRefresh()%>">
                   <% Log.debug("CRN cache: [crn_mainheader.jsp].[globalnavdropdown] - is recalculating"); %>
                   <% monMan.start("WSCRN.MyCRN.Header.GlobalNavCategory (XSLT)"); %>         
                   <dp:documentProvider id="globalNavCategory" scope="page" pagerId="htmlPager">
                        <dc:cacheDocument cacheName="<%= CRNSearcherConst.APPLICATION.EXTENTED_CSH_DOCUMENTPROVIDER_CACHE %>">
                             <csh:cshextract DOMDocumentID="<%= CRNSearcherConst.APPLICATION.EXTENDED_CSH_DOM_ID %>" DOMDocumentScope="application"/>
                        </dc:cacheDocument>
                        <%-- apply xsl filter to get rid of unsubscribed nodes --%>
                        <dp:xmlTransform isXSLTFilterEnabled="true"
                                             xslFileUri="<%= PortalHelper.getCSHFilterXSLFileUrl() %>"
                                             >
                             <dp:xmlParam name="subscribedProductsAssm" value="<%= userProfile.getProductsSubscribedAssm() %>" />
                             <dp:xmlParam name="listItemSeparator" value="<%= userProfile.LISTITEM_SEPARATOR %>" />
                             <dp:xmlParam name="showUndefinedPubs" value="false" />
                             <dp:xmlParam name="nav-type-toShow" value="Global" />
                             <%-- diagnostic mode when access rights have to be ignored --%>
                             <diag:paramCheck name="<%= CRNSearcherConst.DIAG.IGNOREACCESSRIGHTS %>" value="on">
                                <dp:xmlParam name="showNotSubscribedPubs" value="true" />
                            </diag:paramCheck>
                           </dp:xmlTransform>
                        <%-- generate drop-down box with only subscribed nodes that have attribute nav-type equal to Global --%>
                        <dp:xmlTransform isXSLTFilterEnabled="true" xslFileUri="<%= PortalHelper.getGlobalNavigationDropDownXslFile() %>"
                                             dtdUri="<%= PortalHelper.getDTDUrl(PortalHelper.getAssembliesCollectionId()) %>" >
                             <dp:xmlParam name="CRNSearcherConst.URL.GLOBAL_NAV_PATH" value="<%= CRNSearcherConst.URL.GLOBAL_NAV_PATH %>" />
                             <dp:xmlParam name="CRNSearcherConst.URL.GLOBAL_NAV_LINK" value="<%= CRNSearcherConst.URL.GLOBAL_NAV_LINK %>" />
                             <%-- diagnostic mode when access rights have to be ignored --%>
                             <diag:paramCheck name="<%= CRNSearcherConst.DIAG.IGNOREACCESSRIGHTS %>" value="on">
                                  <dp:xmlParam name="ignoreaccessrights" value="true" />
                             </diag:paramCheck>
                        </dp:xmlTransform>
                   </dp:documentProvider>
                   <% monMan.stop("WSCRN.MyCRN.Header.GlobalNavCategory (XSLT)"); %>
                   <form name="sites" style="margin-top: -2px;margin-left:5px;">
                        <select name="browseCRN" onchange="goToURL()">
                             <option value="0" selected>Browse the CRN...</option>
                             <option value="mycrn.jsp">My CRN</option>
                             <%
                             List trackerCatList = (List) application.getAttribute("TrackerCategoryList");
                             String prodSub = userProfile.getProductsSubscribed();
                             if(TrackerSort.hasTrackerSubscribed(trackerCatList, prodSub)) {
                                  %><option value="mytracker.jsp">My Trackers</option><%
                             %>
                             <%-- display dynamic global navigation options --%>
                             <dp:displayPage ifInPlaceThenDisplay="true" scope="page" documentProviderId="globalNavCategoryDocumentProvider" />
                        </select>
                   </form>
              </oscache:cache>                            
    <%-- --%>                       
                            <IMG height=17 alt="" src="../img/label_search.gif" width=50>
                       </DIV>   
                      <DIV class=middle-col style="width:330px;">
                                  <% monMan.start("WSCRN.MyCRN.SimpleSearchDisplay-searcher.AllFile"); %>
                                  <jsp:include page="../search/searcher/simpleSearchDisplay-searcher.jsp">
                                       <jsp:param name="<%= CRNSearcherConst.URL.FORM_ACTION_URL %>" value="<%= CRNSearcherConst.JSPFILES.SEARCHRESULTS_PAGE %>" />
                                       <jsp:param name="<%= CRNSearcherConst.URL.SEARCHMASKFORM_HIDDEN_FIELD %>" value="<%= CRNSearcherConst.JSPFILES.SIMPLESEARCH_MODULE %>" />
                                  </jsp:include>
                                  <% monMan.stop("WSCRN.MyCRN.SimpleSearchDisplay-searcher.AllFile"); %>
                        </DIV>
                        <%-- modifed PM 1/4/2006 --%>
                      <DIV class=right-col
                           style="
                           <% if(isContentViewerHeader){ %>
                                position: absolute;top: -45;right: 2;text-align:right;width:580px;padding:0px;margin:0px;     
                           <%}else{%>
                                margin-top:-1px;text-align:left;margin-left:0px; 
                           <%}%>">
                             <% if (isContentViewerHeader){ %>                    
                                  <jsp:include page="../ssouserprofileproductaccess.jsp" />
                             <% } %>                                
                           <% if (!(request.getParameter("doNotShowSearchHelp") != null && request.getParameter("doNotShowSearchHelp").compareTo("true") == 0)){ %>                      
                           <A href="<%= mycrn_helplink.toString() %>" target="_top" style="margin-left:3px;margin-right:3px;">Search Help</A>|<%}%><A href="advancedsearch.jsp" target="_top" style="margin-left:3px;margin-right:3px;">Advanced Search</A>|<A href="<%= CRNSearcherConst.JSPFILES.RULESEARCH_MODULE %>" target="_top" style="margin-left:3px;margin-right:3px;">Rule Search</A>|<A href="savedsearches.jsp" target="_top" style="margin-left:3px;">My Searches</A>
                      </DIV>   
                      <% } %>                                   
                    </DIV>       
              </DIV>
    <%--  main jsp--
    <%--
    <%@ page language="java" %>
    <%@ taglib uri="diag.tld" prefix="diag" %>
    <%@ page import="com.wolterskluwer.eip.crn.PortalHelper" %>
    <%@ page import="com.wolterskluwer.eip.crn.MonitorManager" %>
    <%
         MonitorManager monMan = new MonitorManager();
         monMan.start("WSCRN.ContentViewerTop.TotalTime");
         request.setAttribute("monMan",monMan);
    %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <HEAD>
    <TITLE>content-viewer-top.html</TITLE>
    <!-- characterset is set to ISO-8859-1 to match encoding in docview.xsl that generates document in ISO-8859-1 encoding -->
    <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <link rel="stylesheet" type="text/css"  href="../css/content-viewer_screen.css"/>
    <link rel="stylesheet" type="text/css" href="../css/global.css">
    <script language="javascript" type="text/javascript" src="../jscript/contentviewer.js"></script>
    <script type="text/javascript">
    var oImgExpand = new Image;
    oImgExpand.src = "../img/toc_expand.gif";
    var oImgCompact = new Image;
    oImgCompact.src = "../img/toc_compact.gif";
    function toggleExpand(){
         oFrameset = parent.document.getElementById("framesContent");
         oImg = document.getElementById("toc-button");
         oBut=document.getElementById("s_h_button");
         if (oImg.src.indexOf("img/toc_expand.gif")>-1){
              oImg.src = oImgCompact.src;
              oFrameset.cols = strTemp;
              oBut.value="Hide TOC";
         }else{
              strTemp = oFrameset.cols;
              oImg.src = oImgExpand.src;
              oFrameset.cols = "0,*"; //changed from 192 to 0 by artp
              oBut.value="Show TOC";
    function OpenWindow(strURL, strName, intWidth, intHeight,toolbar){
         objPopUp = open( strURL, strName, "toolbar="+toolbar+",width="+intWidth+",height="+intHeight+",scrollbars=yes,resizable=yes,menubar=yes,personalbar=yes,location=yes");
         //reSetTimerTop();
    function printContent(){
         parent.frameRight.print();
    </script>
    <script type="text/javascript" src="../jscript/minmax.js"></script>
    </HEAD>
    <BODY>
    <DIV id="content-viewer-top-stretch">
         <jsp:include page="../WEB-INF/jspinclude/mainparts/crn_mainheader.jsp" >
              <jsp:param name="contentViewerHeader" value="true"/>
         </jsp:include>
    </div>
    <div id="content-viewer-top">
         <% monMan.start("WSCRN.ContentViewerTop.ContentViewerHeader"); %>
         <jsp:include page="/WEB-INF/jspinclude/contentviewer/contentviewerheader.jsp" />
         <% monMan.stop("WSCRN.ContentViewerTop.ContentViewerHeader"); %>
    </div>
    </BODY>
    </HTML>
    <% monMan.stop("WSCRN.ContentViewerTop.TotalTime"); %>
    <diag:paramCheck notName="showtime">
    <%
         out.print("<!--");
         out.print(monMan.report("\n"));
         out.print("-->");
    %>
    </diag:paramCheck>
    <diag:paramCheck name="showtime" value="on">
    <%
         out.print(monMan.report("<br>"));
    %>
    </diag:paramCheck>Message was edited by:
    bobz

  • [Test(expects="Error")] not functioning as expected

    When testing against implementation code which is expected to throw an exception the test fails even when the expected exception is thrown.
    I broke this test down into a very simple example to help illustrate the issue:
    public class ExpectsExampleTest
        [Test(expects="Error")]
        public function testExpects():void
            throw new Error();
    The above code result in the following error:
    6/11/2009 23:23:39.519 [WARN] FlexUnit4 There was 1 failure:
    6/11/2009 23:23:39.522 [WARN] FlexUnit4 1 tests::ExpectsExampleTest.testExpects Error
    Not sure if I am missing something or not, however the implementation appears to be correct.
    Thanks,
    Eric

    mlabriola wrote:
    Eric,
    there was a bug surrounding this issue. Latest bits in SVN should have it corrected. There was a difference between the docs and code.
    if you get the latest, it will work as is, or, you can change the word expects to expected and it will likely work in yours.
    It the new version it accepts either,
    Mike
    thanks mike, you're right

Maybe you are looking for

  • Screen Freezing and mouse stopping

    Please please help, in an easy way. SInce yesterday my screen has been freezing and my mouse has been sticking, i have to shut if with the off switch as control alt delete doesnt work either I have tried everything i can think of, please help in easy

  • Null focus cycle root  (getFocusCycleRootAncestor)

    I've got a strange problem I can't figure out. I have a JComboBox in a JTable cell (the JComboBox is the component of CellEditor). When I focus the combobox, then hit TAB, focus is transfered outside of the JTable instread of back to it (I think it s

  • Macbook air dead

    MAcbook air won't start, yosemite. It is completely dead. Smc and pram don't work. Yesterday it was fine, i left it asleep.

  • Apple TV with Ethernet connection no show in iTunes

    My ATV works fine on Wi-Fi, however I would like it to connect to the internet via Ethernet as it is always quicker for downloads. When on Wi-Fi it shows up in iTunes, but as soon as I plug in the Ethernet it disappears. Please note this is nothing t

  • Video card/games

    I have a powerbook g4 with a nVIDIA GeForce FX Go5200 32mb card (about 1-1/4 years old). I'm baffled by the requirements for playing games and hoping someone can tell me whether ones with GeForce2 MX or better will play properly on my machine - e.g.