Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

java programming

Posted on 2004-10-03
4
Medium Priority
?
172 Views
Last Modified: 2010-03-31
for(int i = 0; i < fields.length; i++) {
                  try {
                        hasAccess = fields[i].isAccessible();
                        fields[i].setAccessible(true);
                        System.out.println("F[" + i + "] = " + fields[i] + " : " +
                        fields[i].get(data));
                        fields[i].setAccessible(hasAccess);
                  } catch(IllegalAccessException iae) {}
            }

what's the  purpose of  i&lt?
0
Comment
Question by:sraveend
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 19

Assisted Solution

by:ramazanyich
ramazanyich earned 200 total points
ID: 12213935
It should be replaced by < sign:
 for(int i = 0; i < fields.length; i++) {
0
 
LVL 2

Assisted Solution

by:Breadstick
Breadstick earned 400 total points
ID: 12214114
If you replaced > with &lt; because you thought html would be rendered in your post, it was unnecissary.  I'm not sure if that was your question though.

If this was your question:
"What is the  purpose of  i<fields.length in this block of code?"
Then your answer is, i<fields.length is the condition that must be met before the loop will finish iterating.

A for loop consists of three parts, the initialization, the condition, and the statement.
for ( init   ;   condition   ;   statement )

The initialization sets an initial state for a variable.  The condition is the condition that the variable must be in before the loop will finish.  And the statement is what to do in order to change the variable in your condition.  For example,
for ( i=0; i<5; i++)
The first part "let there be a variable called i, and have it initially set to zero".  The second part says: "keep iterating through the loop while i<5 is true", and the third part says: "after each iteration through the loop body, increment i".

Sorry if that was confusing, I hope that helped.
0
 
LVL 37

Accepted Solution

by:
zzynx earned 400 total points
ID: 12214998
"&lt;" is just HTML code for the character "<"  (lt stands for "less than")
"&gt;" is the HTML code for the character ">" (gt stands for "greater than")

I guess you get this by copying/pasting the code from the source code of an HTML page.
So, that should be:

          for (int i = 0; i < fields.length; i++) {
0
 
LVL 37

Expert Comment

by:zzynx
ID: 12216226
Thanks for accepting
0

Featured Post

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question