Introduction to Java
JAVA was developed by Sun Microsystems Inc in 1991 and later acquired by Oracle Corporation. It was developed by James Gosling and Patrick Naughton
Java is a programming language and a platform. Java is a high-level, robust, object-oriented, and secure programming language.
Before Java, its name was Oak. Since Oak was already a registered company, so James Gosling and his team changed the name from Oak to Java.
Platform: Any hardware or software environment in which a program runs, is known as a platform. Since Java has a runtime environment (JRE) and API, it is called a platform.
Why java?
Programs written in Java have a reputation for being slower and requiring more memory than those written C++.However, Java programs' execution speed improved significantly with the introduction of compilation 1997/1998, the addition of language features supporting better code analysis (such as inner classes, the StringBuilder class, optional assertions, etc.), and optimizations in the Java virtual machine, such Hotspot becoming Sun's default JVM in 2000. With Java 1.5, the performance was improved with the addition of java. util. concurrent package, including lock-free implementations of the Concurrent Maps and other multi-core collections, and it was improved further with Java 1.6.
Features:
1) Automatic memory management:
Auto memory management is used by java for efficient storage purposes. The programmer determines when objects are created, and the Java runtime is responsible for recovering the memory once objects are no longer in use. Once no references to an object remain, the unreachable memory becomes eligible to be freed automatically by the garbage collector. Something similar to a memory leak may still occur if a programmer's code holds a reference to an object that is no longer needed, typically when objects that are no longer needed are stored in containers that are still in use. If methods for a non-existent object are called, a null pointer exception is thrown
2) object-oriented language:
Java follows object-oriented principles. In Java, everything is an object an instance of the class of any real-world entity
3)Platform Independent:
Unlike C, C++ java is a platform independent. Java Programmed developed applications on any machine. in which java byte code is being generated.
4)Simple: Java is simple to learn. Understanding OOP Principles will make it easy to code
5)secure: Java-based developed applications are virus-Free and tamper-Free. In real-time authentication, based systems can be developed on java with key encryption
6)Multi-Threaded:
Java can be used to develop multi-tasking applications, in which multiple tasks can be simultaneously executed involving a multi-threaded concept where multiple threads are simultaneously executed.
7)Interpreted: java is an interpreted language where line-by-line execution is done, depth intuition java uses a hybrid compiler meant it is a combination of compilation and interpretation
Special Classes:
1)Swing
Java Swing is used to developing GUI applications. In real-time is to write GUI widget drawing underlying platforms
2)Java Server Pages(JSP):
Java Server Page uses java Code involving HTML script can be put in special symbols <% and %>
3)Servlet:
Servlet technology provides Web developers with a simple, consistent mechanism for extending the functionality of a Web server and for accessing existing business systems
Java servlets are worked with HTML script processing HTTP requests.
Implementing Hello World Program in Java
public class HelloWorld{
public static void main(String[] args ){
System. out. print("Hello World")
}
}
Social Plugin