Features Of JAVA
- Simple Language (concepts remain the same throughout )
- It is object-oriented (related to real-world objects)
- Java .jar files are portable
- Java is platform independent
- Java is secure
- There is a clear separation between Java and OS
- It is robust
- Java has high performance as it is both complied and interpreted both
- Java has just in time compiler which increases its speed
- Java has multiple threads
- Java has a huge community of help
- Java is statically typed language
class vs objects
- Class is like the blueprint for the object
- Object is the actual realization of the object, also called an instance of the class
- Every object has two things a.property or variables b. action or function can also be called a method they are created at run time
- When we want to create an object we need to have a class
- To call the method defined inside a class we compulsorily need to have an object
- JVM will always need an entry point which is the main method
- public keyword indicates that the method is accessible outside
- Static indicates that does not create an object but directly calls the method inside
hence we have a public static void main
Naming Convention in Java
- Classes are named with starting capital letter
- variables and methods should be starting small letter
- For combined word use camel casing which means the second word is capital
Typecasting In Java
- Implicit type casting happens when we are widening smaller to a bigger range
- Explicit type casting happen when we are going from bigger to smaller or narrowing