friki data migration
posted 4 months ago
What should every Java greenhorn know?
(For more advanced topics, check out the Java-FAQ.)
What does a Java program look like? How do I run my very first Java program? Got no money for books so how can I learn Java? I want to buy a couple of books about Java. What do you recommend? Where is the Java API? What non-Windows Support is there for Java? What's a JAR file, and how do I make it executable? How do I make an .exe of my Java program? Classpath, what is it and how do I set it? What is a Singleton? What is threading or multi-threading? What is an object? What is the difference between an object and an instance? What is a class? What's the difference between a static field and an instance field? Can you override a static method? Is Java call-by-reference or call-by-value? What is a JVM? JRE? JDK? How do I clear the console screen? Why is 1.0 - 2.0/3.0 != 1.0/3.0? (and other arithmetic inaccuracies) What are the differences between an interface and an abstract class? Where can I find example code for the XYZ class? What are the differences between the various JDK versions? I'm having trouble understanding how algorithm XYZ works. How do I work with dates, in particular, convert between dates and strings? What is a compile-time constant? Can I test code without installing anything? How do I override the equals and hashCode methods?
(For more advanced topics, check out the Java-FAQ.)
- See the HelloWorld program
- See the HereYouWillFindLinksToFreeStuff.
- Browse through JavaRanch's book reviews. If you see a book that satisfies your needs a simple click will take you straight to where you can order it.
- You can both browse and download the documentation. See JavaApiDocs for a description of how to navigate them.
- OS X, Solaris and Linux
- IBM AIX
- IBM z/OS
- IBM i (formerly System i, iSeries, and AS/400)
- IBM Linux
- OpenVMS and Tru64 Unix
- various OSes: OpenJDK
- See JarFiles
- Maybe using executable JarFiles would be more appropriate. See the MacOsxFaq for hints on how to build a double-clickable OS X application.
- JWrapper creates native Windows, Linux and OSX apps.
- See HowToSetTheClasspath.
- See SingletonPattern
- See the ThreadsAndSynchronizationFaq
- It's a thing with state and behavior, of course.
- It's an instance of a class
- An object is a User-defined Data Type (UDT).
- A class is the definition of some object data type.
- Class is the basic building block of an object oriented system.It is a an entity which acts as a data type and also shows behaviour.A class can have attributes and functions of its own.Thus it can act on messages and also maintain its state.
- Instance fields belong to objects (which are instances of a class) with each object having its own copy.
- Static fields belong to a class, and we all know there's only one of each class, so there's only one copy of each static field.
- Static variables are initialized at the class load time, instance variables are initialized before a constructor is executed.
- A JVM (Java Virtual Machine) is an imaginary (theoretical) machine that executes Java bytecodes.
- A JRE (Java Runtime Environment) is a software implementation of a JVM and all the standard Java libraries, and other bits and pieces that are needed to make the thing actually work.
- A JDK (Java Developer's Kit)is the JRE plus tools like the Java compiler, debugger, and other things needed for basic Java development.
- The diagram on this page visualizes it nicely: JDK and JRE are brackets on the left, while the JVM is the layer at the bottom.
- Arithmetic as done by Java has limits to its accuracy. Some of these have to do with the fact that computer arithmetic is done with base 2, not base 10. Another reason is that 1/3 does not have a finite representation in either base 2 or base 10. You can find a more detailed description here . All the details can be found in the article What Every Computer Scientist Should Know About Floating-Point Arithmetic
- Java implements exact arithmetic with the JavaDoc:java.math.BigInteger and JavaDoc:java.math.BigDecimal classes. As an aside, calculations involving amounts of money should never be done with floats or doubles, but always with BigDecimal.
- Another option is to use decimal arithmetic, which avoids the problems caused by binary numbers. More information about that can be found here
- The documentation of each JDK release contains a page called "New Features and Enhancements" (or similar), which lists the changes from the previous release. You can find links to the documentation of the various releases here. The javadoc page for a class also mentions the JDK version in which it was introduced.
- Visualization of sorting algorithms
- Visualizations of several basic data structure and sorting algorithms: http://algorithms.openmymind.net/
- Niklaus Wirth's Algorithms and Data Structures covers sorting algorithms and recursive algorithms
- Visualization of string search algorithms
- Visualization of depth-first and breadth-first tree traversal by Renaud Waldura
- Simplex optimization algorithm: graphical visualization
- various algorithms
- The JavaDatesFaq has example code for the most common tasks, as well as links to some further material.
- See Henry Wong's in-depth explanation.
- Youjavait lets you compile and run classes online