Uploaded by reactj

Java

advertisement
1
Assignment1: Java Programming Environment
CST8116_472
Introduction to Computer Programming
Assignment 1
Java Programming Environment
040887519
Ayah Alasttal
Istiaque Shahriar
March 11, 2022
This study source was downloaded by 100000800566080 from CourseHero.com on 09-23-2022 14:53:08 GMT -05:00
https://www.coursehero.com/file/164898896/AyahAlasttalAssignment1docx/
2
Assignment1: Java Programming Environment
Java Programming Environment
The history of Java Programming Language
Java programing language is a class-based and object-oriented programming language
used in creating web-based applications through web-based steps (servers) in different ways.
Java was created by Dr. James Gosling, and sun microsystem published the first copy in late
1995. When developing applications, programmers and developers now use Java as their base
programming language. There is also a kit in the system called Java Development Kit (JDK); It
assists developers and programmers in writing and executing because it has development tools
to help.
The types of Java Programming
There are three types of Java programming: Application, Servlet, and Applet.
-
Application is a stand-alone program (the applications on the existing system), for
example, the games on PC.
-
Servlet is a java program language that programmers use to create or expand an
application function that is executed through web servers.
-
Applet is one of Java programs. They are accomplished through web browsers (any page
with HTML), for example, any website you view on the browser.
Object Oriented Programming language
This study source was downloaded by 100000800566080 from CourseHero.com on 09-23-2022 14:53:08 GMT -05:00
https://www.coursehero.com/file/164898896/AyahAlasttalAssignment1docx/
3
Assignment1: Java Programming Environment
Object-oriented language is a programming language that focuses on displaying the
object with its details. For example, if we are creating data or a program for an enterprise, we
need to know what they are focussing on or presenting, and then create the program and the
details that will be helpful for the enterprise and customers to display. Then, we can combine all
the information into one shared class to start our programming.
Object-oriented programming is easier and more effective than procedure-oriented in many
areas. It is easier to design your program and has a more secure level. It is also based on the
“real world” (Geeks for geeks, 2019).
An Example of Simple Java program
The following example is about writing a program to print the sum of two numbers. The
test data will be 70+30.
Public class SumOfTwoNumbers
{
Public static void main(String args[])
{
System.out.println(30+70) ;
}
}
-
Public class means that it is displayed for all users; I put the words that will be shown to
the users as Sum of Two Numbers.
-
After putting what will be displayed, I put the opening curly brace {, which shows the
class’s beginning after it. I put main(String args[]) phrase to refer to what will be
This study source was downloaded by 100000800566080 from CourseHero.com on 09-23-2022 14:53:08 GMT -05:00
https://www.coursehero.com/file/164898896/AyahAlasttalAssignment1docx/
4
Assignment1: Java Programming Environment
presented in my program and put opening curly brace after to explain that the method
will start at that point.
-
System.out.printIn(30+70) phrase refers to I want the program to print, the number 100
because it is the answer to my equation; this (;) refers to the end of the statement.
-
There are two closing curly braces at the end. The first one refers to the end of the main
method. The second one refers to the end of the class.
Java Program Development Life Cycle
Step 1: Write
Java Source
Code
Source Code File
Output
Java program
Development
Life Cycle
Step 3:
Executing a
Java Program
Java Bytecode
Step 2:
Compiling a
Java Program
Step 1: Write Java Source Code
This study source was downloaded by 100000800566080 from CourseHero.com on 09-23-2022 14:53:08 GMT -05:00
https://www.coursehero.com/file/164898896/AyahAlasttalAssignment1docx/
5
Assignment1: Java Programming Environment
After creating the program outline and understanding what we will be doing, we need to start
writing the actual program. There is also a Source code file that we need to consider, and it
needs to be related to the class.
Step 2: Compiling a Java Program
This step is done by using the javac compiler tool in the JKD. It takes the language we wrote to
create the program to a different language familiar to the computer, called Bytecode.
Step 3: Executing a Java Program
The last step is accomplishing the program. Java takes Bytecode and transfers it to a machine
code using Java Virtual Machine (JVM) and then executes the program showing the expected
output.
This study source was downloaded by 100000800566080 from CourseHero.com on 09-23-2022 14:53:08 GMT -05:00
https://www.coursehero.com/file/164898896/AyahAlasttalAssignment1docx/
6
Assignment1: Java Programming Environment
Reference
Geeks for geeks. 2019. Differences between Procedural and Object Oriented Programming.
Retrieved from https://www.geeksforgeeks.org/differences-between-procedural-andobject-oriented-programming/ opens in new window
This study source was downloaded by 100000800566080 from CourseHero.com on 09-23-2022 14:53:08 GMT -05:00
https://www.coursehero.com/file/164898896/AyahAlasttalAssignment1docx/
Powered by TCPDF (www.tcpdf.org)
Download