core java
WWW.JAVA2BLOG.COM
content Overview Where Java used Class Object Simple Java Program Program execution Java VS. C++
Overview Java is an High-level, object oriented and platform independent programming language. It was developed by James Gosling. There are 4 editions of Java 1. JavaSE (Java Standard Edition) 2. JavaEE (Java Enterprise Edition) 3. JavaME (Java Micro Edition) 4. JavaFX
Where Java used Java is used in many places: 1. Desktop application 2. Web application 3. Enterprise application 4. Mobile application 5. Embedded System 6. Robotics 7. Games
class a class is a collection of similar type of objects. It is a logical entity. It is a template which represents objects.
class { data; methods; }
object
An object is a real time entity that has state and behavior. It is a physical as well as a logical entity. For example, Pen is an object which has state (name, color, size) and behavior (writing).
java program class Demo { public static void main(String args[]) { System.out.println("Hello"); } }
Cont... class: It is used to declare a class. public:- It is access specifier. It makes the main method visible to every where. static: we don't have a need for any object to invoke the main method. void:- It is a return type. It means the main method doesn't return any value. String args[]: It is used for command line argument.
program execution Java source code is converted into byte code by Java compiler. Source Code
Byte Code
Compiler
Java byte code is converted into machine code. Byte Code
Interpreter
Machine Code
Java Vs. C++
The main difference between Java and C++ is that Java is platform independent language and C++ is platform dependent language. Java doesn't support multiple inheritance, operator overloading, Explicit pointers, Structures, Union whereas C++ supports all these features.
thank you
WWW.JAVA2BLOG.COM