Java Code Translation

Good Day Experts

I am relatively new to Java...the programming is getting better.  However, I am still thin on the terminology to explain the code.  Here are some lines of code that I am using but am curious how they "translate".  UserInput is my LinkedList.  Can someone reply with the proper way to say what each of these lines of code are?

import java.util.LinkedList;  
String[] UserInputTokens = UserInput.split(delims);
for (String t : UserInputTokens ){
       //process
}

Thanks,
jimbo99999
Jimbo99999Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mick BarryJava DeveloperCommented:
import java.util.LinkedList;  

tell the compiler what class you will be using

String[] UserInputTokens = UserInput.split(delims);

split the UserInput string on the delim delimiter

for (String t : UserInputTokens ){
       //process
}

Loop processing each of the tokens returned from splitting the UserInput string

0
Jimbo99999Author Commented:
Thanks sounds good...

One last inquiry about the line --> String[] UserInputTokens = UserInput.split(delims);

How do you say what the [] are after String?

Thanks,
jimbo99999
0
Gurvinder Pal SinghCommented:
Its the array of String object type. Means that each item of that array is of type string
0
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

Mick BarryJava DeveloperCommented:
0
for_yanCommented:

In Java, I guess as opposed to C and some other languages, you can
declare arrays with the array specification after the variable, as well as
before the variable - between the variable and the type.

You can either declare:

String myStrings[];

or you can say

String [] myStrings;

At first this latter method looks odd when you come from other
languages, but it is probably even more popular in Java programs
 than the former way

0
Jimbo99999Author Commented:
Thanks...I forgot one.  Promise the last one.

When I add the token to my LinkedList i do --> UserInputList.add(x)

How do I explain that in English?  I know this is bad that I use it and cannot describe but I am learning.

Thanks,
jimbo99999
0
for_yanCommented:
What is it you wnat to explain?
You just add one more lement to the collection
0
for_yanCommented:

What is it you want to explain?
You just add one more element to the collection, as your linked list is one of the variants of a collection
0
Jimbo99999Author Commented:
UserInputList.add(x)

Do you say execute .add method on UserInputList ?
0
for_yanCommented:
Certianly, when you have an instance of an object separated by dot from the method
name it means that we want to execute this method on that instance
of the object.

add(Object ) is one of the methods of List interface (implemented by LinkedList class)
which we excute on UserInputList instance of LinkedList
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gordon_vt02Commented:
On a side note, you may want to take a look at the Java Coding Conventions Style Guide.  Typically in Java variables and method names start with a lowercase letter using camelCase for subsequent words in the name.

So, in your code, you would use userInputList instead of UserInputList.  It's just a guideline, but it will make your code more readable and understandable to other Java programmers.

http://www.oracle.com/technetwork/java/codeconv-138413.html
0
Jimbo99999Author Commented:
Thanks to everyone who replied.  All your contributions help out a lot.

Thanks again,
jimbo99999
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.