Topics Discussed
Setting Path variable for java - why to set path ?
Principles of Object Oriented Programming
Application of Java
According to Sun, 3 billion devices run Java. There are many devices where Java is currently used. Some of them are as follows:
Desktop GUI/Stand alone applications:
Standalone applications are also known as desktop applications or window-based applications. These are traditional software that we need to install on every machine. Examples of standalone application are Media player, antivirus, etc. AWT and Swing are used in Java for creating standalone applications.
Web - Applications:
An application that runs on the server side and creates a dynamic page is called a web application. Currently, Servlets, JSP, Struts, Spring, etc. technologies are used for creating web applications in Java.
Mobile Applications:
Java Platform, Micro Edition (Java ME or J2ME) is a cross-platform framework to build applications that run across all Java supported devices, including feature phones and smart phones. Further, applications for Android, one of the most popular mobile operating systems, are usually scripted in Java using the Android Software Development Kit (SDK) or other environments.
Along with these java is very much used in domains like
1. Class
2. Object
3. Abstraction
4. Encapsulation
5. Inheritance
6. Polymorphsim
Features of Java
1. Simple:
Easy to learn and understand because java follows syntax similar to popular languages like c and c++.
Easy to learn and understand because java follows syntax similar to popular languages like c and c++.
2. Object Oriented:
Java follows oops principles which makes software development and maintenance more simple and clear.
Java follows oops principles which makes software development and maintenance more simple and clear.
3. Platform independent:
Unlike C, C++ and other languages java is a write once run anywhere language. Java produces platform independent code called Byte code (.class) which can be run on any platform(OS) with the help of JRE(JVM).
Unlike C, C++ and other languages java is a write once run anywhere language. Java produces platform independent code called Byte code (.class) which can be run on any platform(OS) with the help of JRE(JVM).
4. Secured:
Java is secured because there will be no memory leaks, unlike languages c and c++ memory management is taken care by java itself, thus no other user can access data from other applications.
Java is secured because there will be no memory leaks, unlike languages c and c++ memory management is taken care by java itself, thus no other user can access data from other applications.
5. Robust:
Java supports Exception handling which makes the application more reliable and Java follows type checking mechanism.
Once you declare a variable to be a certain type, the compiler will ensure that it is only ever assigned values of that type and avoids programmer from commiting type errors.
Example -
float f = 66.997;
int i = f; // throws type error as the decimal values will be truncated.
We may think what a big deal in losing the decimal value, Let's assume value is 66.997crores then losing the precision value .997 has big impact.
Java supports Exception handling which makes the application more reliable and Java follows type checking mechanism.
Once you declare a variable to be a certain type, the compiler will ensure that it is only ever assigned values of that type and avoids programmer from commiting type errors.
Example -
float f = 66.997;
int i = f; // throws type error as the decimal values will be truncated.
We may think what a big deal in losing the decimal value, Let's assume value is 66.997crores then losing the precision value .997 has big impact.
6. Architectural - Neutral:
Java is architectural-Neutral because it doesn't follow implementation dependent features
Example - for integer type C occupies 2bytes of memory in 32-bit architecture and 4bytes of memory in 64-bit architecture. Whereas
Java occupies 4 bytes for both 32 and 64 bit architectures.
Java is architectural-Neutral because it doesn't follow implementation dependent features
Example - for integer type C occupies 2bytes of memory in 32-bit architecture and 4bytes of memory in 64-bit architecture. Whereas
Java occupies 4 bytes for both 32 and 64 bit architectures.
7. Portable:
Java doesn't require any extra efforts or implementation to shift byte code from one platform to another platform which makes java portable.
Java doesn't require any extra efforts or implementation to shift byte code from one platform to another platform which makes java portable.
8. High Performance:
Java produced byte code can be easily converted to native code(machine code - operaring system executable). Though it is bit slower than languages like c and c++. The Just In Time(JIT) compiler of java helps in translating byte code to machine instructions efficiently and gives high performance.
Java produced byte code can be easily converted to native code(machine code - operaring system executable). Though it is bit slower than languages like c and c++. The Just In Time(JIT) compiler of java helps in translating byte code to machine instructions efficiently and gives high performance.
9. Distributed:
Java is most used for distributed application as java supports RMI(Remote Method Invocation) and EJB(Enterprise Java Beans) thus helps in accessing objects, files, and remote methods over the internet.
Java is most used for distributed application as java supports RMI(Remote Method Invocation) and EJB(Enterprise Java Beans) thus helps in accessing objects, files, and remote methods over the internet.
10. Multi - Threaded
Multiple tasks can be performed concurrently using Java's multi threading. It is much useful for creating Web applications.
Multiple tasks can be performed concurrently using Java's multi threading. It is much useful for creating Web applications.
11. Dynamic:
Java is dynamic because it loads classes and methods when needed at run time. It also supports functions from native languages such as C and C++ through JNI(Java Native Interface)
Java is dynamic because it loads classes and methods when needed at run time. It also supports functions from native languages such as C and C++ through JNI(Java Native Interface)
Application of Java
According to Sun, 3 billion devices run Java. There are many devices where Java is currently used. Some of them are as follows:
Desktop GUI/Stand alone applications:
Standalone applications are also known as desktop applications or window-based applications. These are traditional software that we need to install on every machine. Examples of standalone application are Media player, antivirus, etc. AWT and Swing are used in Java for creating standalone applications.
Web - Applications:
An application that runs on the server side and creates a dynamic page is called a web application. Currently, Servlets, JSP, Struts, Spring, etc. technologies are used for creating web applications in Java.
Mobile Applications:
Java Platform, Micro Edition (Java ME or J2ME) is a cross-platform framework to build applications that run across all Java supported devices, including feature phones and smart phones. Further, applications for Android, one of the most popular mobile operating systems, are usually scripted in Java using the Android Software Development Kit (SDK) or other environments.
Along with these java is very much used in domains like
Cloud Computing applications
Distributed applications
Gaming applications
Scientific applications, etc.
PROGRAMS
Cycle 1
1. Program to default values of primitive data types in Java
1. Program to default values of primitive data types in Java
2. Program to find area of triangle given length of all 3 sides
https://anotepad.com/notes/i4rgt9c
https://anotepad.com/notes/i4rgt9c
Cycle 2
please check the post Cycle II
a) To find the roots of a quadratic equation ax^2+bx+c
b) Program to display qualified racers, whose speed is greater than the average speed of all racers
please check the post Cycle II
a) To find the roots of a quadratic equation ax^2+bx+c
b) Program to display qualified racers, whose speed is greater than the average speed of all racers
c) Java program that displays the name of the day, based on the value of day, using the switch statement.
d) Develop a Java program to search for an element in a given list of elements using Linear Search.
e) Develop a Java program to perform multiplication of two matrices.
f) Develop a Java program using StringBuffer to perform various operations on a string.
Comments
Post a Comment