javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

It is: for(int i = 0;i<10;i++) And the correct way would be: for(int i = 0;i<in.length;i++) Also the OP, better add some checks whether the file has at least 10 lines:

for(int i = 0;i<in.length;i++) {
  String line = in.readLine();
  if (line==null) { // no more lines to read;
    break;
  }
  id[i]=in.readLine();
  result[i]=id[i];
}
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

So start by creating the GUI. Use the instructions of the assignment and/or add what you think that is necessary. The instructions tells you what the GUI must have so create those elements and add them to the gui. That would be the first step. Just create the GUI with no actions. Surely you have notes or you can find examples.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

You can start by explaining what a a restuarant bill calculator is?
After you explain it, start converting that explanation into java classes, and the calculations needed into methods.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

When you use: for (int i=0;i<length;i++) And others use: for (Object o:array)

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

If you have used javascript and jquery before while developing web pages then you can put it, why not? You can never be sure how expert you are because there is always someone better, but if you are familiar with you can add it.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Read the error messages that you get. They tell you exactly what the problem is:
cannot find symbol
symbol : variable count

The program cannot find the count variable. Have you defined it? Is it visible?

Also when you do: DVDcollection[index] , the DVDcollection needs to be an array. The error messages tells you exactly that.

The messages also tell you the lines where the error occurred.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

That is completely wrong. Don't give advices if you don't know what you are talking about. All you did is repeat the poster's code. If you say that the 10 needs to be 9 (which is wrong), then why didn't you do the same at the second loop?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

What errors do you get and where are you having problems. The code seems ok. Which part of your assignment doesn't work.
What test cases have you tried?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Go at the line where the error tells you. You are using something there which is null. Something you haven't initialized. Also you cannot read a file if you don't know that it has enough lines in it.

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


  // the last command of the while is:
  line = in.readLine(); 
  // you read the next line and go to the beginning of the while in order to check if it is null (no more lines to read)
}

Take the line and put it into your array. You need to check, the length of the array if it is enough to put elements inside. If the file has more lines than the length of the array

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

I didn't understand much from your question, but if you have read the data from the database, and you want to have a link, and put some data to the url of that link then:

<%
String someValue="";
%>

<a href="page.jsp?paramName1=<%=someValue%>&paramName2=....&paramName3=...." >Display Text</a>

And at page.jsp:

String param1 = request.getParameter("paramName1");
String param2 = request.getParameter("paramName2");
String param3 = request.getParameter("paramName3");
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Usually when you have a check box and you submitted, then if it was not checked the request.getParameter("paramName") will return null, Otherwise it will return a not null value.
Assuming that you have those check boxes in a for loop with index 'i', you can have the check box be like this:

<input type="checkbox" name="checked_<%=i%>" />

If you pass the total number of check boxes at the request, you can have a for loop like this:

for (int i=0;i<N;i++) {
  String check = request.getParameter("checked_"+i);
  if (check!=null) {
    // check box was check, save value
  }
}

In order the get the other values you can do the same:
example:

<td>
<input type="text" name="name_<%=i%>" value="<%=theObjects[i].getName()%>" />
</td>
<td>
<input type="text" name="desc_<%=i%>" value="<%=theObjects[i].getDesc()%>" />
</td>

And take those values in the same way you take the values of the check boxes.
In total:

Page1.jsp:

<form action="Page2.jsp">
  <input type="hidden" name="length" value="<%=theObjects.length%>" />
.....
   <%
      for (int i=0;i<theObjects.length;i++) {
   %>
       <tr>
<td>
<input type="text" name="name_<%=i%>" value="<%=theObjects[i].getName()%>" />
</td>
<td>
<input type="text" name="desc_<%=i%>" value="<%=theObjects[i].getDesc()%>" />
</td>
<td>
<input type="checkbox" name="checked_<%=i%>" />
</td>
       </tr>
   <%
      }
   %>
.....
</form>

Page2.jsp

int N = Integer.parseInt(request.getParamater("length"));

for (int i=0;i<N;i++) {
  String check = request.getParameter("checked_"+i);
  if (check!=null) {
    // check box was check, save value
    String name = request.getParameter("name_"+i);
    String desc = request.getParameter("desc_"+i);
  }
}

Each row will have the same 'i'. So you can use that to take the value of each element in the same row, whose the check box was checked. Assuming …

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Why use StringBuffer and simply display at the hmtl the code:

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>

<html>
<head>
</head>
<body>
<font size="+1" color="#55BBEA">Not a member yet? Register here. It is FREE. </font><br>
<html:form action="/register">

<table>
<tr>
<td align="left">
<bean:message key="label.register.fname"/>:
</td>
<td>
<html:text property="firstName"/>
</td>
</tr>
</table>

</html:form>


<html:messages id="message" message="true">
<bean:write name="message"/><br>
</html:messages>

</body>
<html>
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Are you saying strRead is null for the first line of the text file? I don't think that is the case, but I will try to verify that.

students[p].parse(line1); //<==Null Pointer?? I believe that Majestics is right. You initialize the students array, but the elements of the array are null.

students is not null: Student students[] = new Student[num_students]; But did you initialize the students[p] ?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster
<td colspan="3"><input name="text4" id="vid" type="text"/></td>
                    <td colspan="1">
                        <select name="combo1" onchange="document.getElementById('vid').value=this.option[this.selectedIndex].text">
                            <option>Select One</option>
                   <%
                   stmt=con.prepareStatement("Select id from student order by id");
                   ResultSet rst=stmt.executeQuery();
                   while(rst.next())
                       {
                    %>
                            <option><%=rst.getString("id")%></option>
                     <%
                   }
                   }
                  catch (Exception e)
                   {
                       System.out.println("error in program:-"+e);
                   }
                   %>
                        </select></td>

hope it might work for u..

That code is completely wrong. Don't give advices if you don't know what you are doing. For starters you don't close anything. Zero re-usability. You don't set the value attribute of the options tag so what's the point of having a select box and the user doesn't gets notified if an exception occurs!

Everything needs to be in its own class with a method that returns the values of the select box in a list or an array.
Then in the jsp you call the method and loop the list. Also inside the list/array, there should be an object with attributes for the value of the option as well as what would be displayed.


--- Create a method that retrieves the data from the database and returns them. Call that method from a main method and test it. Once you are done, you can call it in the jsp. You can post the method if you have any problems with the code. Get it done and afterward you will deal with the jsp/presentation part.

kvprajapati commented: words :) +14
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

You can have the action of the form be the same page. Like: <form action="" method="get"> The submit tag should be like this: <input type="submit" value="Send" name="submitTag" > Then at the same page; you can write that code wherever you want:

String name = request.getParameter("name");
....
String submit = request.getParameter("submitTag");

And at the place that you want to display your data:

<%
if (submitTag!=null) {
%>

<tr>
    <td>Name:</td>
    <td><%= name %></td>
  </tr>
  <tr>
    <td>age:</td>
    <td><%= color %></td>
  </tr>
  <tr>
    <td>adds:</td>
    <td><%= address %></td>
  </tr>

<%
}
%>

The first time the page loads the "request" is empty. Nothing has been submitted. So everything there is the request is null: request.getParameter

But when you submit to the same page the "request" now has data and they are not null. So you can use that check:
if (submitTag!=null)
In order to determine if the page has been submitted or not and display the data.

If nothing has been submitted everything that you get from the request would be null. So:
If the check with the submit doesn't work, you can use something else.
if (name!=null) {

....
}

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Try to print the stack trace in order to get a better understanding:

<% 

try{
java.net.URL url =config.getServletContext().getResource("/textfile.txt");BufferedReader buffreader =new BufferedReader(new InputStreamReader(url.openStream()));
String strLine;
while ((strLine = buffreader.readLine()) != null)  
{
	out.println(strLine);
}
	}catch (Exception e){
                e.printStackTrace(); // HERE
		System.err.println("Error: " + e.getMessage());
		}
%>

You probably get a NullPointerException somewhere

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

There is no such function. Can you post the code?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

First of all: Delete the entire code. Never do that again. That code needs to be in a separate class. Create such a class and put the code that connects to the database and does whatever you want in a method and call that method. That method should return(true/false) whether the operation was successful or not in order to print the message.

Second and most important. Stop writing jsps. The error that you get has nothing to do with jsps. When someone starts writing jsps, it is supposed, that they know java. They know the basics of java. The error that you get is not about jsps, so even if you are new to jsps you should be able to fix it, just by reading the error messages of the compiler.
It is a basic beginner's error that anyone that starts writing jsps must be able to fix it.
You should be writing more exercises and studying more basic java.
You don't even close anything in your code! You should be closing the Connection, Statement and ResultSet in the finally block not only the Connection in the try

The above is an advice. Not to be taken personally. You should know more things than you already know before going and writing such code. Even in core java you should be using classes and put code in methods so you can call it elsewhere instead of putting the entire code in the main method (in your …

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

The NullPointerException could mean that something is null at that line. Can you try this small debug code:

<%@page import="bank.User"%>
<%@page import="java.util.List"%>
<%@page import="bank.BankHelper"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <h1>Hello World!</h1>
        <%
        BankHelper helper = new BankHelper();
        List<User> users = helper.getUsers();

        System.out.println(users); // this prints at the server not the web page

        if (users!=null) {
          for(User user : users)            
          {
        %>
             user is <%=user.getSurname()%>
             <BR>
        <%
          }
        } else {
        %>
           users is NULL!
        <%
        }
        %>
    </body>
</html>

If you still get errors post them as well the updated line where they occur

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

The browser remembers the password when you try to login. It will not keep you logged in. And it remembers the password only at the computer that you saved it.
When you logout with the above code you will not be allowed to proceed unless you login again.
Of course it is unwise to save your password at a browser/computer that many people use.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

When you login, put the user name into the session: session.setAttribute("USERNAME", <username_of_the_user>); When you log out remove it: session.setAttribute("USERNAME", null); And in every page take the USERNAME from the session and check if it's null. If it is then who ever went to that page hasn't login:

<%
String username = (String)session.getAttribute("USERNAME");
if (username==null) {
%>
  // redirect to login page with message
<%
}
%>
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Take the name as a String and then manipulate it. Shouldn't be that hard since you are already moved on to jsps.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Are you getting the same error?
Did my suggestion work?
What changes did you do?
What is the error now?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

It seems that the cm.getColumn(1) doesn't have any columns: java.lang.ArrayIndexOutOfBoundsException: 1 >= 0
Meaning that the jtab.getColumnModel() doesn't have a ColumnModel.

You could try to look the API for JTable and/or DefaultTableModel becasue I find strange the way you create your JTable instance.
I think that maybe you don't declare at the model the columns.

Also you should do this even if it is not part of your problem:

// String[] a = {"Time","O","F","O","F","O","F","O","F"};
while (rs.next())
	{
String [] a = new String[9];

        String tst = rs.getString("TimeStamp");
  	if (tst!=null) a[0]=tst.substring(11,16);

  	a[1]=rs.getString("Temperature");
  	a[2]=rs.getString("Temperature");
  	a[3]=rs.getString("Rainfall");
  	a[4]=rs.getString("Rainfall");
  	a[5]=rs.getString("Wind");
  	a[6]=rs.getString("Wind");
  	a[7]=rs.getString("Rh");
  	a[8]=rs.getString("Rh");
   		
   model.addRow(a);                       
	}
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Post the line where you get the exception.
If you read the stack trace you will find it. Also it is clear from the message what the problem is:
java.lang.ArrayIndexOutOfBoundsException: 1 >= 0
You are trying to access an array (or some thing like that) with invalid index.

Also this is wrong:
rs.getString("TimeStamp").substring(11,16)
How do you know that the string represantation of the Time stamp would have that length (16).

What kind of sql type is TimeStamp? If it is date try this:

java.sql.TimeStamp stamp = rs.getTimeStamp("TimeStamp");
if (stamp!=null) {
  java.util.Date timeStamp = new Date(stamp.getTime());
  // use the SimpleDateFormat class to format the java.util.Date timeStamp into the String that you want
}
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Each if checks a different number. You should be checking only one variable which should be renamed to choice for easier reading and understanding the code. Just because you can name a variable: int shdnjbscsfdcmc = 1; It doesn't mean you should because no one understands what it does. Read only one number, put it into one variable and use that at the if:

int choice = 3;

while (choice>=1 && choice<=3) { // because the valid numbers are 1,2,3. With your way if the user entered -1 then the loop would not stop

  System.out.println("enter a number 1,2,3>");
  choice = input.nextInt();

  if (choice == 1)
{
   // read 2 numbers and add them
}

if (choice == 2)
{
 // read 2 numbers and multiply them
}

if (choice == 3) {
  System.out.println("congratulations!!!!!!");
}

if(choice > 3 || choice < 1)
{
System.out.println("you have entered an invalid number try again");
}

}

Also watch your { , } when you open one you must immediately close it. There was a case where you had a single '}' without a '{'

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Did you enter an integer number? Usually when I got that exception with scanner it was because of that. Because I see this at what you posted:
Enter Employee Contact Number:456645

Are you sure that is where you get the error. The exception tells you where you got that error:

Enter Employee Contact Number:456645
Exception in thread "main" java.util.InputMismatchException
	at java.util.Scanner.throwFor(Unknown Source)
	at java.util.Scanner.next(Unknown Source)
	at java.util.Scanner.nextInt(Unknown Source)
	at java.util.Scanner.nextInt(Unknown Source)
[B]	at employeestore.EmployeeStorer.addEmployee(EmployeeStorer.java:55)[/B]
	at employeestore.EmployeeStorer.main(EmployeeStorer.java:25)

at employeestore.EmployeeStorer.addEmployee(EmployeeStorer.java:55)

Can you post some more code before and after the line: 25. Also indicate in your code that line.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

What errors do you get and how does the code behave? What does it do that it is not suppose to?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

I believe that the request.getParameter("test") will give you the value "1", not the "Hi". Why do you think that it is not working?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Post the full code and how your file looks like

For the newLine to work you need:

BufferedWriter output = null;

....

output = new BufferedWriter(new FileWriter(file));
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

In your code you wrote:

if (.....) 
  System.out.println(aList)

But now you added more code under the if, so you need:

if (.....) {
  String line2Save = aList.toString();
....
....
}

Also you need to create the BufferedWriter outside the loop. With your way, you create a new instance every time. Just create it once outside the loop, call the the write inside the loop, and outside the loop close it.
Like my example.

Also I would suggest this:

output.write(line2Save);
output.newLine();
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

It is like I said. If you have examples that show you how to create and write to file the use that and save what the toString returns:

public class ShowFiles {
 public static void main(String[] args) throws FileNotFoundException {

    List<File> listFiles = ScanFiles.getFileList();
    // open file

    for (File aList : listFiles) {
            if (aList.isFile() && (aList.getName().toLowerCase().endsWith(".txt")
                 || aList.getName().toLowerCase().endsWith(".java"))
)
         String line2Save = aList.toString();
         // write to file
     }

     // close file
  }
}
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Example:

class Contact {
  private String name = null;

  public Contact() {
  }

  public Contact(String name) {
    setName(name);
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getName() {
    return name;
  }

}

The name is private so no one can access it outside the class.
The getName is the accessor to get the name
The setName is the mutator to change the value of the name.

As you can see, accessor, mutator are just fancy words. Just add in the class whatever your assignments says that a Contact should have, make them private and add get/set methods.

Then provided that you have java 1.5 and later you can create the ArrayList and put as many as you like:

ArrayList<Contact> list = new ArrayList<Contact>();

Contact cnt1 = new Contact();
cnt1.setName("my name");

Contact cnt2 = new Contact("my other name");

list.add(cnt1);
list.add(cnt2);

for (int i=0;i<list.size();i++) {
  Contact cont = list.get(i);

  System.out.println("Name: "+cont.getName());
}
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Doesn't the JList already do what you want? Why do you need the tag?

MyObject myObject = (MyObject)jList.getSelectedElement();

Have you looked the API for JList, or examples?

EDIT. Why don't you put "My Object" as a String attribute in the class MyObject and loop the JList and search by that?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Loop the ArrayList. Then each element is also an ArrayList. So take each element of the first ArrayList and loop that to in an inner loop:

ArrayList<ArrayList> [B]list[/B]
loop [B]list[/B] {
  take each array_list inside [B]list[/B]
  loop that array_list {
    // do whatever
  }
}

But I don't think that it is good practice to have an ArrayList of array lists

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

The aList is java.io.File. When you do:
System.out.println(aList)
What the compiler actually does is, it calls the toString method of the object you passed as argument to the println method. So:
System.out.println(aList.toString())

So my question is. What do you want to save in your file?
The file names? : ScanFiles.getFileList() of this list ?

Also I think that your if should be like this:

if (aList.isFile() && 
[B]([/B]aList.getName().toLowerCase().endsWith(".txt") || aList.getName().toLowerCase().endsWith(".java")[B])[/B]
)
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Let me know if the below program is right or wrong..??

And you still haven't explained what mug is. And this is not a joke, seriously. Throwing random code without explaining what you want to do, or not compiling it and see for your self, is really bad.

At least if you explained your problem we could give you hints and advices on how to proceed.

Also in one of your posts, I loved the way you copy pasted code from some other site, without having a single clue of what you posted:
import <strong class="highlight">java</strong>.awt.*;

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

The exception must be in its own class - file. So you will have 3 files:
MyDateException.java
TestMyDate.java
MyDate.java

In the constructor of MyDate if the isValid method returns false, you will throw the exception.

Apart from that you are ok. Although you will need to correct the logic in the isValid method.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

whatever it is, he has to do it himself. We're not doing it for him.

Aren't you a bit curious? :)

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

What is java mug ?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

You can use the Locale class to get the current configuration

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

I don't remember the exact syntax for the auto-increment, but you can try this:
Instead of having the auto-increment part in the insert query:

ex: insert into table (id, ... ) values (NEXT_VAL, ... )


You can have a select that returns that auto-increment value:
ex: select NEXT_VAL from dual

Then take that value as a String, add the value "5" or "9" in front of it and use that at the insert query.

The "dual" keyword is used in Oracle. You can search the web for the equivalent in mySQL.
EDIT: The dual is also used in mySQL so you can use it at the select to get the incremented value

Can you also post the sql code you use for the auto-increment ?

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Usually from where you got the example, there should be some link where you can download the jar. You can also search the net.
Don't forget though to add the jar to your classpath

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Read the error messages:
Only a type can be imported. org.apache.commons.fileupload.disk.DiskFileItemFactory resolves to a package

Since DiskFileItemFactory is a package, you know that it cannot be imported like that.
Packages are imported like this:
org.apache.commons.fileupload.disk.DiskFileItemFactory.*

Example:
java.util.*
or
java.util.Date

NOT:
java.util

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Can you post again the code using code tags?
Just click the button (CODE) and put your code between the tags.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

At the namecity why do you initialize the array with 6 and you ignore the argument 'i'

At the printcity method why do you ignore the argument and you call the namecity method with argument 6 even though inside the namecity you ignore the argument
and why do you have 2 loops where you loop both arrays when you need to loop only the argument!

And USE the length of the array at the loop, not hard coded values:
for (int i=0;i<array.length;i++)

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster
String []irawan=new String [i];

The 'i' needs to be an integer. You initialize like this:
String []irawan=new String [5];
Not like this:
String []irawan=new String ["5"];

Also you loop the array like this:
for(int k=0;k<p.length;k++) p is the array.

Not like this:
for(int k=0;k<i.length;k++ ) i is not the array. irawan is.

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

First of all phrase is the input file and phrase2 is the word you want to search. why do you compare them.
Also never compare Strings with == or != . Use: equals:
str1.equals(str2)

Try running this code:

while (fileScan.hasNext()) {
  String line = fileScan.nextLine();
  if (phrase2.equals(line)) {
    System.out.println("This file does contain the string \"" + phrase2 + "\"");
  } else {

  }
}

Or using your code, although I haven't tested:

int i = 1;
while (fileScan.hasNext(phrase2)) {
  System.out.println(i + ": This file does contain the string \"" + phrase2 + "\"");
  i++;
}

Or if you don't want to read the entire file, then use the first version and once the phrase2 is found brake from the loop:

boolean found = false;
while (fileScan.hasNext()) {
  String line = fileScan.nextLine();
  if (phrase2.equals(line)) {
    found = true;
    [B]break;[/B]
  }
}

// use the found variable
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

Read the error messages, go to the lines they say and try to correct them.
Also do some studying. Most of the mistakes are because you failed to "copy" correctly the commands from your book or notes to the editor.
Look again how the commands are syntax-ed.

You should have examples on how to correctly use for-loops or how to create an object with "new":
new BufferedReader(...)
NOT
newBufferedReader(...)

javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster

if statements.