I'm not even a Noob. I'm Pre-Noob. I have some limited previous knowledge of C++ that I've practically forgotten. A hack of the worst kind, I can't get far reading instructional books before I rip my hair out. The best way for me is to get the basic syntax down and just dive in doing some coding. When I hit a snag, I go to the net and fish for awhile, hit a book or two, find my answer and then push on again until my next snag.
Incredibly foolish Noob question #1
netbeans can't seem to find any of the packages (I think they are called) that I need for simple keyboard input. I get a squiggly red line under the "i" in the first line of a code that I copy/pasted from the net: "import java.io.*;" Same squiggly under the "i" for: "import java.util.Scanner;". Both won't compile or run.
A couple days ago I DL'd the latest JDK/Netbeans bundle from sun/oracle. I'm thinking that there is maybe a supplemental library of these so-called "packages" that I need? But I've poked around the sun/oracle DL site and it ain't jumpin' out at me.
I'm tryin' to find the easiest way to simply read in information from keyboard input.
Does anyone dare face the limitless ignorance of a noob?
BTW the easiest way to get input (that works within Netbeans - you can type in the Output window by clicking on it) is with Scanner: do something like this:
s.nextLine() is a String, so obviously you could assign it to a String variable or whatever.
(I'm assuming you mean reading text from the keyboard, rather than detecting keypresses, which is a lot more involved.)
I recommend if you are a real newbie/noobie, you don't use NetBeans. Use a decent text editor (eg Notepad2, Notepad++, jEdit on Windows®, or gedit or kate on *nix). M$ Notepad is not particularly good, and can introduce confusing errors by adding an extension.
Use the command line. There is something about that in the Java™ Tutorials; go through that section missing out the OS you don't use and the NetBeans version.
You might have a control character which you can't see preceding the "i" in "import" and the compiler will see that as an error. Both those packages you are looking for are standard sun/Oracle pacakges, which should be inside the file called rt.jar, which you will find inside your Java™ installation folder. So you ought not to have to download anything else at this stage.
More detailed instructions for running LP's little class
Open a command prompt or a terminal (start→all programs→accessories→command is one way to open it on Windows®)
mkdir java (or similar name. You can now use that folder for ever.)
Edit a file called HelloYou.java and save it in that folder. Note name of file and name of class should match.
Beware: there is very little scope for spelling errors. Note where you have to miss out the .java extension.
Thank you Luigi and Campbell Ritchie. It did have something to do with my setup in netbeans. I was able to input from keyboard. Maybe it's because i'm older but Java feels like its hurting way more than when I dabbled in C++. I've got some books coming from the library that I hope will help. I guess I'm alot older too. Maybe my gray matter is bogging down a bit.