Java Programming Part 13: First Java Program Using IDE



To use this type of IDE, you need to download and install it on your PC. Below are the basic features of Eclipse program that you should know before you do and run your first java program






Package Explorer
The Package Explorer view, shown by default in the Java perspective, shows the Java element hierarchy of the Java projects in your workbench.




Editor Window
A window where you write, display, and edit code




Problems View
shows errors and warnings in the current project. For example, if the code contains invalid character, this list will say so. Its extremely useful as it clearly tells you the type of the error(s) showing a full description, file name, line and everything else that helps you easily find and fix the error










The output will appear under Console View


1. Press the Run [  ] button in the workbench toolbar 


Java Programming Part 12: How to run java in a Command Line



Go to start menu, Type cmd






Type cd desktop, on my example I save my java file on the desktop that's why I added '"cd desktop

Type javac Test1.java to compile the java program, this will produce a .class file

Type 'java Test1' , then press enter. The program will appear after you hit enter

Java Programming Part 11: First Java Program



-----------------------------------------------------------------------------
Open notepad and add the code as above.
Save the file as: Test1.java
-------------------------------------------------------------------------------------------------------------------





Java Programming Part 10: Setting up the path for windows



--------------------------------------------------------------------------------
Go to start menu> Right click My Computer > Properties > Advanced System Settings > Environment Variables button > Select Path under System variable text field > Click Edit button. Make sure you see something like the following. Paste the copied file path .
-------------------------------------------------------------------------------

Java Programming Part 9 : How to install Java Development Kit


-----------------------------------------------------------------------------------------------------------------------
Firstly, download the latest JDK Standard Edition for Windows from oracle.com. Double click the binary.
-----------------------------------------------------------------------------------------------------------------------


-----------------------------------------------------------------------------------------------------------------------
Double click an EXE file to install
-------------------------------------------------------------------------------




-----------------------------------------------------------------------------
Accept the License Agreement.
The JDK installation process begins.
For the second stage, select components that you want to install. Select all components. Click Next when you finish.

-------------------------------------------------------------------------------------------------------------------


Java Programming Part 8: Tools you will need


------------------------------------------------------------------------------------------------------------------------
The minimum software requirements to program in Java are:  a text editor like Notepad++ or 

IDE – Integrated Development Environment
An IDE is a suite of programs that developers need, combined into one convenient package, usually with a graphical user interface. 
---------------------------------------------------------------------------------




Java Programming Part 6: What is Java?



--------------------------------------------------------------------------------------------------------------------
Java is a high-level programming language originally developed by Sun Micro-systems and released in 1995. Java runs on a variety of platforms, such as Windows, Mac OS, and Linux. 
--------------------------------------------------------------------------------------------------------------------

 
---------------------------------------------------------------------------------------------------------------------
Java programming language was originally developed by Sun Microsystems which was initiated by James Gosling and released in 1995 as core component of Sun Microsystems' Java platform (Java 1.0 [J2SE]).
---------------------------------------------------------------------------------------------------------------------


----------------------------------------------------------------------------------------------------------------------
What are the main areas where Java is used?

Android Apps
if you want to see where Java is used, you are not too far away. Open your Android phone and any app, they are actually written in Java programming language
---------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------
Software Tools
Many useful software and development tools are written and developed in Java e.g. Eclipse, InetelliJ Idea and Netbeans IDE.
-------------------------------------------------------------------------------






---------------------------------------------------------------------------------
The Java compiler javac transforms a .java source file into a .class file that is written in Java bytecode, which is the machine language for an imaginary machine known as the Java Virtual Machine.
---------------------------------------------------------------------------------

Java Programming Part 5: Compiler and Interpreter



-----------------------------------------------------------------------------------------------------------------------
Compiler is a program that compiles source code into executable instructions that a computer can understand.
-----------------------------------------------------------------------------------------------------------------------



-------------------------------------------------------------------------------
Interpreter is a program that executes programming code directly. Interpreter can convert a source code, usually on a step-by-step, line-by-line and unit-by-unit basis into machine code.

Example of interpreted languages : 

Python
JavaScript 
Pearl
---------------------------------------------------------------------------------


Java Programming Part 4: High Level Language


---------------------------------------------------------------------------------
allows us to write computer code using instructions resembling everyday spoken language (for example: print, if, while) which are then translated into machine language to be executed.
--------------------------------------------------------------------------------


--------------------------------------------------------------------------
They are considered high-level because they are closer to human languages.
Examples of High-level Languages:
C
C++
JAVA
BASIC
COBOL
PASCAL
PHYTON
ASP.net
VB.net

------------------------------------------------------------------------------------------------------------------



-----------------------------------------------------------------------------
The problem is that the computer doesn't understand high level language,  so we need a way to convert it to machine code.High level language must use interpreter, compiler or translator to convert human understandable program to computer readable code (machine code).
-------------------------------------------------------------------------------

Java Programming Part 3: Assembly Language



---------------------------------------------------------------------------------
Binary Notation(1 & 0)  is very hard to understand , that is why Assembly Language was developed. 
--------------------------------------------------------------------------------------------------------------------------


 --------------------------------------------------------------------------------
Assembly language is a a programming language that consists of instructions that are mnemonic codes for corresponding machine language instructions.

Ex. 

DATA SEGMENT     MESSAGE DB "HELLO WORLD!!!$" ENDSCODE SEGMENT      ASSUME DS:DATA CS:CODESTART:       MOV AX,DATA      MOV DS,AX      LEA DX,MESSAGE             MOV AH,9      INT 21H      MOV AH,4CH      INT 21H      ENDSEND START
--------------------------------------------------------------------------------------------------------------------------





---------------------------------------------------------------------------------
The problem is that the computer doesn't understand the assembly code, so we need a way to convert it to machine code, which the computer does understand.Assembly language programs are translated into machine language by a program called an assembler. 
---------------------------------------------------------------------------------


---------------------------------------------------------------------------------
An assembler is a program that takes basic computer instructions and converts them into a pattern of  bits ( 0 & 1) that the computer runs to produce result
---------------------------------------------------------------------------------


-----------------------------------------------------------------------------------------------------------------
 Assembly language is easier for a human to read and can be written faster, but it is still much harder for a human to use if you don’t know exactly the internal structure of computer.
----------------------------------------------------------------------------


Java Programming Part 2: What is Machine Language?


---------------------------------------------------------------------------------
Machine language is a collection of binary digits or bits that the computer reads and interprets.It  is the only language understood by computers.

Machine Language:
“0110101100101000” 
---------------------------------------------------------------------------------


-----------------------------------------------------------------------------
Computers cannot understand human languages, unless there is software to translate it to something the CPU can understand.
-----------------------------------------------------------------------------


Java Programming Part 1 : What is Programming Language?



Learn the basics of Java programming language language syntax and object-oriented programming. Gain practical experience by designing, writing, compiling, and executing simple Java programs.

Things you may need to learn before writing a program in Java





¡A computer program is a step by step instructions that tells the hardware what to do. 
Examples of hardware are

Microsoft Office such as : 
1. MS Word
2. MS Access
3. MS Excel

Operating System such as : 
1. Windows xp, 7, 8, 10
2. Mac OS X
3. Android OS
4. iOS


------------------------------------------------------------------------
Software , programs , and applications are all the same 
------------------------------------------------------------------------

--------------------------------------------------------------------------
Without software, computer is useless
--------------------------------------------------------------------------

--------------------------------------------------------------------------------

A programming language is a set of rules that provides a way of telling a computer what operations to perform

Programming languages can be used to create computer programs. 
The term programming language usually refers to high-level languages, such as C, C++, COBOL, FORTRAN, Java, C-Sharp, Pascal, ASP.Net & VB.net.
---------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Types of Programming Language are: 

1. High Level Languages
2. Low Level Languages 
3. Assembly Language
4. Machine Language
------------------------------------------------------------