Java is object-oriented where each object can perform one or more discrete tasks and contains all the data needed to perform the task.
Java is distributed, you can send data across the net easily.
Java is robust, so programs run correctly and do not break when the unexpected happens.
Java is secure by limiting access of programs to your resources and files on your computer.
Java is architecture-neutral and portable by writing the code in one computer and running the code on another machine with another hardware configuration.
Java byte code is interpreted by a virtual machine not directly by the operating system.
Java is multithreaded as the programs share data and instructions.
Java is dynamic by calling upon resources as needed.
In order to learn this language, I recommend this path of action:
- Know how computers work
- - CPU, ALU, RAM, Thread, Process, Memory Address, and Interrupts
- Know how CPU instructions carried out
- - Assembly language instructions ( mov, jmp, cmp, add, ... )
- Know how file systems store data and how to manage your files in folders
- Know basic command line utilities ( dir, mkdir, rmdir, copy, set, echo, ... )
- Know how to get help from the local system or utilities and how to read the help documentation
- Know about path and other environmental variables
- Understand basic automation commands in the terminal
- - i.e. for %i in ( 1 2 3 4 ) do echo Hello World %i
- Understand basic script execution and syntax
- - i.e. hello.bat -> for %%i in ( 1 2 3 4 ) do echo Hello World %%i
- Understand difference between JRE and JDK
- Install and run ( javac, java ) simple Java program written in notepad.exe ( see below )
- Learn C++ function and structure concepts
- Understand the importance of documentation ( javadoc )
- Understand the importance of flowcharts, pseudo code, UML
- Create simple algorithms based on what you know
- i.e. Calculate the are of a circle
- create a table with columns radius, diameter, PI, area
- enter values into radius column
- calculate diameter and keep in mind the function ( d= 2 * r )
- write PI for each row ( this will need to be accessed by each row, so it is static )
- calculate the are ( a = r * r * PI )
- analyze the results
- each column with changing values without formula will be variable
- each formula columns will be function/method
- each entry that does not change will be final and static for all to access
- value on the left side of the equation will be the return value for the method
- think about the documentation hat would help another person learn about your code
- write the code and look for syntax errors
- determine proper data types for identifiers
- identify unneeded code
- diameter should be removed or changed to hold r*r as a sub-calculation since it can help with troubleshooting, but you can ignore
- think about input validation to ensure positive radius values
- you can create another method to return an absolute value of radius before calculation of area
- enter the values from your table and test if you get the same results from your code
- Use Raptor to create code from flowchart
- Always generate javadoc of your own code and understand how to read it
- Use BlueJ to visualize objects and inheritance
- Use Greenfoot to understand GUI concepts and create simple games
- Move to a full featured Integrated Development Environment ( IDE ) like Eclipse
- Understand how to use the debugger to monitor values in your code at different stages of processing
- Make mistakes and learn from the error messages
- Add features to code you wrote and understand as you learn more about a language
- Don't be afraid to experiment
/** Student Class establishes the student id, name and grade
* @author Richland Teacher
* @version 2015
*/
public class hello
{
private final String studentName;
int value;
public static int year;
/**
* This is a method that will take two parameters and will set a single field in the object
* @param parameterOne imaginary first name as a String
* @param parameterTwo imaginary last name as a String
*/
//Constructor for the hello class
public hello( String parameterOne, String parameterTwo ){
studentName=parameterOne+parameterTwo;
value=100;
year=1900;
}
// Main method
public static void main(String[] args)
{
String name="My name is: ";
System.out.println("Hello, "+name + args[0]);
hello testing = new hello("firstname","lastname");
System.out.println("Hello "+testing.value+" "+year);
}
}// End of class
No comments:
Post a Comment