javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

IF you know C# then you will have little difficulty converting it to java on your own. It will not take you much time to read a few things about java. If you know C# you don't need to learn anything new, just understand a few things about how java works.
If you know C# and you didn't just find someone else's code and you want to convert it to java for your assignment.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

java DooBee
at the cmd to "run" the file .class

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Download from the site of sun the java sdk
http://www.sun.com/download/index.jsp

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Video class:
you need to add the findVideo method. The argument as specified by the .pdf file as well as whta it needs to do. Just create a for-loop that compares all the videos in the array or the ArrayList with the other video given.
you declare a noOfHires vatraible but you don't use it. It needs to have value 0 expilicity in the constructor or where you declare it. Then add a void method (increaseNoOfHires) that increases its value by one. So whenever this video is hired you will call that method.

Hires class:
Rename the Hire (suggestion, you don't have to follow it)
the customer, video variables of the class shopuld not be String but Customer and Video:

public class Hires {
	private String HireID;
	private Video video;
	private Customer customer;
	private String DateHired;
}

You don't need a DateHired argument at the constructor. When you call the constructor call the Date now=new Date() and use the SimplDateFormat object as described in the .pdf file to give value to the DateHired

Main class.
in case 5: you will use the user's input to add data in the HireList. In the begining HireList would be empty, but whenever you call case 5, you will more data.

Add in a while loop almost all your main method. From:

Scanner in = new Scanner(System.in);
int userinput = in.nextInt();
switch(userinput){

till the end.

And when the …

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

n final popup error window:
The class.org.apache.derby.jdbc.clientDriver was not found.
Add the relevant driver using the New Driver action on the Drivers node

If you have added the derby.jar file at the properties of the project, all I can think of is that that you haven't selected the appropriate driver based on the above message.

What kind of code are you using to connect to the database:
Class.forName(?);
What parameters are you passing when you get the connection from DriverManager?

I can't think of anythning else because I don't use netbeans "connections" for the database

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Have you tried to run any other java programs (that don't use connecton to DB) successfully?

Try to do this: Right-click on the project, Properties, Add jar, and add the derby.jar

Have you tried to go to Services tab and connect to the database of your choice?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

If you want to print all the advices that are in the array then I would suggest a new void method that uses a for-loop to print all the elements of the array.

As for the getAdvice(), it is correct, but you are using the advice.length:

int random = (int) (Math.random() * advice.length);

So if your array has values:
{"Advice 1","Advice 2","Advice 3","",""}
Then it is possible for random to take value 3 or 4 which will return nothing. I would suggest to use:

int random = (int) (Math.random() * index);

Use the same in the for-loop for printing all the values:

for (int i=0;i<index;i++) {
  System.out.println(advice[i]);
}
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

how do i start "get advice"??

i have the getRandomIndex on the bottom..

it doesnt do random...and im LOST. lol.

What do you mean how you start it? Create an instance of the object and call its methods.

And the getAdvice method should have an int argument, so you will be able to get the selected value:

public String getAdvice(int i) {
  return advice[i];
}

You have return advice [index]; and since the index variable holds where the next String should be placed, the method will not return anything useful, because you haven't put anything in that place yet.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Do you know WHY you increase the index in the addAdvice method? You increase it because when you add a new advice you don't want it to be placed at the same place as a previous inserted advice. Now look at the constructor and the addAdvice

public Oracle ()
{
advice = new String[5];
index = 0;

advice[0] = "It's as simple as this";
advice[1] = "Search engines like google are great!";
}

public void addAdvice (String entry)
    {
           
       if (index < advice.length) 
       {
           advice[index] = entry;
           index++;
       }
       return;
                   
    }

If you call the constructor and then the add method, the index in the add method will have value 0. So the advice passed as argument in the add method will be placed at the '0' place of the array which will overwtite the "It's as simple as this" of the constructor.

Since you "add" two "advices" in the constructor, you should also increase the index twice as well

Ezzaral commented: helpful point +9
sktr4life commented: thanks for the explanation (arrays) +1
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

I think that KeyPressed is triggered exactly when you press the key. Meaning that you don't have to release the key (lift you finger from the key) to be activated.
As for the KeyTyped I think that is activated you release the key, although I am not sure.

You can test this by adding a System.out.println() inside the "triggers" and when you press the key, keep it pressed and check the console what has printed. Then lifted it and check again.

If someone else knows more please correct me.

I know that the mouse events work the way I described because I used the "mousereleased" (if i remember the name correctly) as trigger for a tic-tac-toe game I made. The 'X' was displayed at the GUI when I was releasing the mouse key

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Hi
You have not assigned any value for s which you declred as String s(as an instance variable)
So JVM considers it as null so by giving s.length it cant count the characters of null so you're getting null ponterException.
You just try by assigning some values ti s and see you will get the length of that s variable.

The thread has already been answered and apparently solved, not to mention that is is 1 year old. Don't give the same answer as a previous post

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster
public class Oracle
{
  private String [] advice=null;
  private int index=0;
  
    public Oracle() {
      advice=new String[5]; //as rerquested to have length 5
      index=0;
    }

//if you want two advice then pass them as arguments and manually increase or set the index
//remember indexis where the next advice will be stored
 
   public Oracle(String adv1, String adv2) {
      advice=new String[5]; //as rerquested to have length 5
      index=0;

      advice[index]=adv1;
      index++;

      advice[index]=adv2;
      index++;
     
     /*
     OR since this is the constructor and you know that these will be the first values: 
     advice[0]=adv1;
     advice[1]=adv1;
     index=2;
      */
    }
}

But why do you want two at the constructor?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Will String.replaceAll do for you?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

First of all don't use the same name for the ArrayList and the argument of addAdvice(). It is bad programming.
Second, does this thing compile? I think that the getAdvice (int index) will have a problem:

public String getAdvice (int index)
    {
        // This is a stub. It returns a fixed advice
        return advice [index];
    }

the variable advice is declared to be an ArrayList, and the method's signature is a String. I would try something like this:
return advice.get(index); or make the advice to be an array.

Although the instructions tells you to use arrays, you use ArrayList. You can have you constructor initialize an array and have a private int variable to monitor at which place you need to add the new advice. Have that variable to be 0 and every time you call add do:

public void addAdvice (String adv)
    {
        //advice should be an array initialized at the constructor
        //index should be initialized at the Constructor with value 0;
       if (index<advice.length) {
           advice[index] = adv;
           index++;
       }
    }

And for getAdvice, use the random number generator but the range should be from 0 to index-1

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster
vac=(4*va*vc);
vbc=(2*vb*vb);
....
raiz = Math.sqrt(vbc-vac);

The correct formula is b*b - 4*a*c. You write: vbc-vac = 2*vb*vb - 4*va*vc

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Interesting.

To check the array that is made of Strings, you just go

if(wordlist[1] = "whatever the name is")

Thats how you check the array of Strings you made.
Your code is very complicated.

char array[]=wordList[0].toCharArray();

What does that above line mean? Your creating an Array called array and it is of char values and of no size. Then you are saying it is equal to the value of wordList[0]. Why are you doing this? It sounds kind of redundent don't you think?

Actually warrior16's mistake was far more serious and shows an incredible lack of java knowledge. I never post a solution that I haven't tried myself so I will know that it will work.

if(wordlist[1] = "whatever the name is")

You NEVER use '==' to compare Strings (you used '=' but let's say that it was an honest mistake).
That piece of code and your next question about the array thing shows that you have no clue about java and you shouldn't even post your so-called solutions, and YOU were the lazy one, not bothering to check the API for the toCharArray() method

PS: Don't let this guy get you Futbol10

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Hello,
this is sasidhar. I am going to attend an Inteview. He gave me a simple project using servlets.

Inventory management. I am searching for procedure in net. If anyone gives Some useful information regarding this I am very thankful.

If I submit this project almost I will get job. I want to submit this job tomorrow.
Please help me.

And what will happen when you deliver the project that you didn't do and then they ask you to build a similar project? Or do you expect that we will do your work until you retire?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

I think that this shouldn't even compile:

Date date;
date = (rcd.getDate(1)==null?"":rcd.getDate(1));

Because if rcd.getDate(1)==null then the expression wil return an empty String: "". But date is type Date:
Plus, I think that the parenthesis should be like this:

date = (rcd.getDate(1)==null)?"":rcd.getDate(1);

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

What errors and what code did you use to connect to the db? Is the applet displaying correctly?
Try to remove the code that connects to the database and see if the applet displays correctly. Have you tested separately in a main method if you connect and read from the database correctly?

PoovenM commented: You're good :) +2
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

... i'd say to have a method that reads the time from thr base then get the HOURs convert it IF needed ex:

public Date convert(Date time){
int mask 12;
if (time <= mask)
time=time+12

You declare time as Date and mask as int ?????? Can you please explain what do you mean, because your code doesn't make any sense.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Hi Irene and welcome to DaniWeb. As you can see from the picture I am also a fan of animes (Ghost In the Shell ROCKS!). I also love Warcraft and Starcraft. What programming language do you usually write?
By the way, try to post questions in relevant threads. This is a thread for welcoming new members

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

I don't know if it is relevant but in what order have you added the C:\j2sdk1.4.2_12 at the environment variables?
Perhaps you need to put first the latest version because once it finds the 1.3.1_01 it doesn't "search" for the rest in the environment variables.

If someone thinks I am wrong correct me.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

What is the sql type of the column in your database?
Perhaps you can alter the query in order to format the column and return it as String:

select TO_CHAR(date_col,'DD/MM/YYYY HH24 : MI : SS') from table tbl;

The date_col would be type DATE at the table and when you get the column from the ResultSet you can use: rs.getString();

I think that if it is type TIME then use only: HH24 : MI : SS in the TO_CHAR method

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

My JApplet skills are a little rusty. But this is what I would suggest. Have you tried to run a single applet as an example that just displays a message in the browser?
Take an example from a tutorial and see if it is displayed correctly.
Then remove what you don't need and try to display everything that you will need except from the pictures.
When you do the above try to add a single picture from a file.
Then try to add the pictures you want.
If you try to do all in once you will not be able to know what is the mistake you have made. But if you try it step by step and somewhere you get an error, you will know at which step is the error.

For example:
don't use: <PARAM NAME="IMAGE1" VALUE="Katrina/kat1.JPEG">
Try at first to hardcode the image in the JApplet class and when you manage to display it, then try to take it from the html.
In that way you will know if the reason why the image is not displayed is the way you get the file name from the html or the code you have in the applet for displaying it.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

First:
I don't know why you need this and what you are trying to print:

String[][] strings = (String[][]) lines.toArray(new String[lines.size()][]);
System.out.println("strings are "+strings[0][0]);
System.out.println("Lines="+strings.length);

Do you what split does? If you knew, then when you do: fields[0] you print the first value of each line. Example

String line="a b c d";
String [] tokens=line.split(" ");

tokens[0] has value: a
tokens[1] has value: b
tokens[2] has value: c
tokens[3] has value: d

From you pm:

could u just write a simple code for example to read from
asdf xcvf ghjk esks
0.21 3.22 1.23 2.45
43.3 3.33 2.21 11.3
2.22 2.44 2.55 3.67

and to get values under ghjk ie 1.23, 2.21, 2.55

Then do

String[] fields = line.split(" ");
System.out.println("fields size is "+fields.length);
System.out.println("fields value is "+fields[2]);
lines.add(fields);

Inside the lines ArrayList you will have the 3rd column of each line.

If you want the y column of the x line as you state in one of your posts then, inside the for loop count the lines with an int variable. ( countLines++; )
When you reach the desired line take the desired column:

//y column
//x line

int count=0;
for(String line = br.readLine();line != null;line = br.readLine()) {
 count++;
 if (count==x) {
  String[] fields = line.split(" ");
  System.out.println("fields size is "+fields.length); 
  System.out.println("fields value is "+fields[y-1]);
 }
}

In the last for-loop the if will be executed only ONCE for the line …

VernonDozier commented: Good post. +3
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Unfortunately you will have to read the entire line and then "extract" somehow the value under the column you want.
You can use:

StringTokenizer and loop as many times as you want to get to the column you want.
OR
String.split(" ") which will return an array and you will get the value that is at the specified index: eg:

COL1 COL2 COL3
value1 value2 value3

If you want COL2

String [] tokens = lineRead.split(" ");
String valueNeeded = tokens[1];

OR
If you have specific length for each value under each column you can use the substring method:

COL1 COL2 COL3
1234 1234 1234
34 234 4
1234 4 34

If you know that the first 4 characters will be the first value, the characters from 5 till 8 the second value and 10 to 13 the third value:

String valueNeeded = lineRead.substring(5,9);

The last one depends on the format of your file. The others are more "free".

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Instantiate the TimeListener target; in the ClockCanvas constructor before you use it.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster
public ClockCanvas(String c,String tz)
{
city = c;
calendar = new GregorianCalendar(TimeZone.getTimeZone(tz));
Timer t = new Timer(1000,this.target);
t.start();
setSize(125,125);
}

I believe that in the above code the target: this.target is null;

Your NullPointerException: target.timeElapsed(this); was because target was null. I have search from where it takes value and found the code that I present in the beginning of the post. The ClockCanvas(String c,String tz) is the constructor. Above that constructor you declare: TimeListener target; So when you call for example:

contentPane.add(new ClockCanvas("San Jose","GMT-8"));

the TimeListener target member of the ClockCanvas doesn't take value. So in this:

Timer t = new Timer(1000,this.target);

this.target is null. Then you call the start method and you get a NullPointerException.

Next Time try to put your code in a try-catch and do a printstackTrace(). That way you will be able to see not only where the exception was but also the path it followed before it is thrown. If you have done that you would have seen all the calls that took place and you would have spotted the place where the null target takes value (or doesn't)

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

First of all this is a java forum. Java and javascript are entirely different.
If the users in the array are not sorted then you are right on how to do it.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

I will briefly explain my problem:
I have a while-loop and inside I call some methods. Inside one of the methods I have this error: java.lang.NoClassDefFoundError, which is been caught and the while continues.

The problem is that a few seconds later as the while keeps running the same method doesn't throw that error and it executes correctly.
Now, you are going to say that the first time the method tried to call something that was not found and the second time the program followed a different path.
This is not the case because the class that the error says it didn't find is being called by practically everything. And 2 times in a row (while the loop was running) I had this error: NoClassDefFoundError but then the class that was appearing at the error gets executed correctly.
That error happened during one execution. Meaning that the program started, the while-loop was repeating, First loop: NoClassDefFoundError, Second loop: NoClassDefFoundError, The other loops No Problems, the class that was giving the error works OK.

I have searched the internet for answers and I have found from this site:
http://mindprod.com/jgloss/runerrormessages.html
the following:

If your NoClassDefFoundError occurs only sporadically, here is a possible cause: You are running some classes in a jar file which is stored on a network mapped drive in MS Windows. Sun keeps the jar files open in order to re-load classes which haven’t been used in a while, and occasional …

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

I have noticed that you don't close anything and that your file doesn't have extension:

String filename = "grade" + myFormat.format(today);

Shouldn't be like:

String filename = "grade" + myFormat.format(today) + ".txt";

I don't know if the above will solve your problem but try to add the .txt and to close:
FileOutputStream, DataOutputStream
Check the API for more details since I don't remember 100% that both of them have a close() method. And if they do then close them in the opposite order you have opened them:

FileOutputStream fileStream = null;
  DataOutputStream output;
  
  fileStream = new FileOutputStream(filename, true);    
  output = new DataOutputStream(fileStream);


  output.close(); 
  fileStream.close();

Again you might want to check which one of them has a close() method.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

There is an expression:

someVariable = (boolean)?value1:value2

Which is used in the code you showed.
If boolean is true then the someVariable will take as value the value1
If boolean is false then the someVariable will take as value the value2

Now compare those two expressions in both codes you sent. What do they return as <value1> and as <value2>?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

I think that the problem is that it does not find the update_issue.jsp page. Probably has something to do with where is the folder where you have you placed the update_issue.jsp file.
I think that you need to specify the path at the link.
You should ask the same question at a jsp forum.

I don't really understand you second question, but if I understood correctly then you will need to put the <option> tags in the while loop where you read from the DB:

<select name="someName">
<%
while(rs.next()) {
%>
<option value="<%=rs.getString(1)%>"><%=rs.getString(2)%></option>
<%
}
%>
</select>
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Read a HTML tutorial: This is what I prefer:
w3schools

And you are at the wrong forum. I think there is a forum for JSPs

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Because you have declared ArrayList to take Strings and you pass as parameter in the add() an array. Decide what you want, arrays or Strings and make the appropriate declaration

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Check the API and see if the add method is static or not:
ArrayList.add(person);
Perhaps it should be al.add(person);

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster
Well this didnt make any difference.

The only think I can think of is to try this:

FileReader fileReader=new FileReader("file.txt");
BufferedReader buffer=new BufferedReader(fileReader);

By the way: Do you close BufferedReader? Probably you do or else you wouldn't be able to read in the first place, but check it just in case:

Do
in.close();
after you finish reading out of the while()

Also close fileReader if you try my suggestion

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Why don't you try this instead:

String linedata = in.readLine();
while( linedata!=null )
{
    //
    //
    // 

   linedata = in.readLine();
}
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

It is obvious that you need to count the brackets.
I don't know how you usually write code, but do not open anything without closing it first.
You need to open an if () { } ?
First write this:

if () {
  
}

And then go and add what you want in the () and the {}. If you need more things in the if then write for example:
if (()&&()) {
for (;;) {

}
}
And THEN write what you want in the the brackets

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

From this output:

Linedata:
java.lang.ArrayIndexOutOfBoundsException: 1

I believe that one of the lines is empty. As you can see nothing is printed after the "Linedata:". So probably you are doing split("#") to an empty line. Therefor the table will have size 0 or 1 (I don't know exactly), but the point is that the array strparse does not have 2 elements so you can execute: strparse[1].
You should check if it is OK to do a strparse[1] to the array:

if (strparse.length>1) //do stuff with the strparse[1]

The exception should help you solve this problem since it says: Array Index Out Of Bounds Exception 1. The index "1" you used for the array is out of bounds. Doesn't have that many elements. Plus the line: Linedata: shows you that you have an empty line

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

hello ....

I need a java code that convert from eqn ( or bench ) format to verilog format....

Does anyone has an idea?!

Thanks in advance....

What is eqn, bench and verilog format?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

The compiler tells you exactly where the errors are. Can't you read the messages and go at the lines the message indicates to fix it?

C:\Users\sars\Desktop>javac indata.java
indata.java:11: class, interface, or enum expected
Public class indata {
^

As you can see the arrow pints at the 'P'. Perhaps there should be a lowercase 'p'.
And don't forget to close: stmt , resultset

And does this look OK to you?

ResultSetMetaData str_buf = resultsset.getMetaData();

StringBuffer str_buf = new StringBuffer();

Two different object with the same instance name: str_buf

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

hello,
your error might be in the function declairation section, where you have used
TextArea t=new TextArea();
rather it should be like this.

TextArea t=new TextArea("");
i am sure that your program will work this way.
good bye.

That is also wrong. Both declarations are correct. If you read the API for JTextArea, and I have, you will see that there are many constructors and the TextArea t=new TextArea(); is correct.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Declare the variables in the class, instantiate them in the constructor. Read about JFrames.
Also I put in the constructor the code that generates the gui. Then call the class from a main method

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Read all the file in an array or a Vector and generate a random number from 0 to size-1. Then take from the array the element that is at the place of generated number.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Even if you create your own Exception you will still need to implement some sort of validation in order to decide whether to throw the exception or not. So it up to you to decide, once you have made the validation, if it is necessary to throw an Exception or not.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

One of our teacher who used to work at the Supply Management of a company (logistics) told us that everybody where making requests for supplies saying that it was extremely urgent, so he could not decide which request to handle first.
Then he came up with the idea not to do anything and wait who would complain first about the delay and handle their request first

peter_budo commented: I like the way your teacher sorted problem ;) +8
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Where did you add the method toString, and what errors do you get? Perhaps post only the class that you tried to add the toString() method.

If you know how to get the percentage from the comboBox then also get the text from the textfield, multiply them and set the result wherever you want:

double percentage=0.15;
double d = Double.parseDouble( textField1.getText() );
double result = percentage * d;
 textField1.setText( result );
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

My swing is a little rusty but if you add an Object in a comboBox, the toString() method will be displayed. And when you try to get the selected item it will return the entire object.

So have an object Person with attributes: name, percentage.
The Person should have a public String toString() { return name; } method.
So when you add the Person john with values:
name="John"
percentage=0.15
to the JComboBox it will be display what the toString method returns: "John"
When you do combo.getSelectedItem(); NOT combo.getSelectedIndex(); you will get the object Person:
Person selectedPerson = (Person)nameCombo.getSelectedIndex();
then selectedPerson will not only have the name but the percentage as well. So you will get it:
selectedPerson.getPercentage(); and multiply with whatever you want and set it to another field.
I have never tried the above approach, but I think that it will work. Also I hope I understood correctly you problem.

majestic0110 commented: Nice help. A true Java Addict :) ! +2
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

.,'just an idea..

try to read the input by each character..
use charAt() to do this,
while reading put a condition,,
if the character is a number then store it in an array in which you will store all the integer character..,
if the character is an operator then store it in another array in which you will store all your operator,..
take note that the array of your numbers, its not yet an integer value yet it is still consider as char value...
you cant directly convert char to integer.
you must convert first char to string then after it you can convert now to integer...
now, cos you store your data in a an array you can have some operations you want to do into it.,


-just try it...
hope it help you to get some idea

And then how would alannabrittany know which number goes to which operand? And you should not store an integer to a char array because if the int is 11 it cannot be turned into the char '11'
If you want to use arrays then use String.split(" "); which will store each number or operand into an array:
String s="1 5 9 + 8 – + ";
will be: {"1","5","9","+","8","-","+"}
Then you can loop, when you find an operand take the previous two: a[i-1]+a[i-2] and then put the result back into the array and continue looping (you …