// jQuery
$(document).ready(function() {
// code
})
Operation | Code |
---|---|
New List |
List<Integer> x = new ArrayList<Integer>(); |
Copy List |
List<Integer> x = new ArrayList<Integer>(y); |
Add an element to the List |
x.add(element) |
Get an elemenet from the List |
x.get(index) |
Clear the list | x.clear() |
New HashMap |
HashMap<Integer, String> x = new HashMap<Integer, String>(); |
Add element to the map | x.put(key, value) |
Get an element from the map | x.get(key) |
- Java Identifiers
- Data types
- How to define our own data type in java(enum)
- Variables
- Scope of Variables
- Loops in Java(Practice)
- For-each loop in Java
- For Loop in Java | Important points
- Decision Making(if, if-else, switch, break, continue, jump)(Practice)
- Switch Statement in Java(Practice)
This file will cover important coding practices that are important to stress when coding this program. Listed below are some of the more important details that should be stressed. Each programmer has his/her own way to deliver code. The importance of having similar coding conventions throughout this program are listed below.
- 80% of the time spent on a piece of software goes to maintenance.
- Hardly any software is maintained for its whole life by the original author.
- Code conventions improve the readability of the software, allowing engineers to understand new code more quickly and thoroughly.
- If you ship your source code as a product, you need to make sure it is as well packaged and clean as any other product you create.
Java is a general-purpose, OOP language designed with the idea of Write Once, Run Anywhere (WORA), meaning that the Java code would work virtually in every computer without the need of re-compilation like C or C++. In order to obtain this unique portability, the computer needs to have the JVM (Java Virtual Machine) installed. Nowadays, Java is the most used programming language in the world, used for almost anything, from embedded programming to large software development, web application development and supercomputers. Java has 3 main implementation named Java EE, Java SE and Java ME meaning respectively Java Enterprise Edition, Java Standard Edition and Java Micro Edition (used in the abbreviated form as J2EE, J2SE and J2ME). Java, firstly developed at Sun Microsystems which merged into Oracle Corporation, was designed with 5 main principles in mind:
- Simple, object-oriented and familiar
Java makes programming simple using its build-in classes,
Eg: int vs Integer
int is primitive type, while Integer is a class (eg: Integer.parseInt("1") is a call of Integer's class method)
All primitive type in Java has an equivalent wrapper class:
- byte -> Byte
- short -> Short
- int -> Integer
- long -> Long
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.