Sitemap
Tharindu Chathuranga

Tharindu Chathuranga

Studding at SLIIT

JAVA & Git-Hub

Introduction JAVA

Java is an Object-Oriented Language. Java programming language was originally developed by Sun Microsystems. Java was initiated by James Gosling in 1995. Java is a high-level programming language. Therefore, it is a human- readable language. It is like human language and very simple and easy. Java is like the syntax of c++ language. Java is case sensitive language. Java language works on different platforms. These platforms are Windows, Mac, Linux, Raspberry Pi, etc.

Class Names — Class names the first letter should be in Upper Case.

Method Names — All method names should start with a Lower-Case letter.

Java supports the following fundamental concepts:

· Polymorphism

· Inheritance

· Encapsulation

· Abstraction

· Classes

· Objects

· Instance

· Method

· Message Parsing

variables in Java

· Local Variables

· Class Variables (Static Variables)

· Instance Variables (Non-static Variables)

The Basic Java Application:

public class MyFirstJavaProgram {

/* This is my first java program.

* This will print ‘Hello World’ as the output

*/

public static void main(String []args) {

System.out.println(“Hello World”); // prints Hello World

}

}

Advantage & Disadvantage

Advantage

Easy to learn

Object-oriented

Platform-independent

Simple Language

Supports Multithreading

Cheap and economical to maintain

Disadvantage

Java is slow and has a poor performance

Verbose and Complex codes

Java provides no backup facility

Get Tharindu Chathuranga’s stories in your inbox

Join Medium for free to get updates from this writer.

Requires significant memory space

Less machine interactive

Consumes more memory since it runs on top of java virtual machine.

Introduction Git-Hub

GitHub is a growingly popular programming resource for sharing code. It’s a programmers’ social networking site that many businesses and organizations use to help with project management and collaboration.

Ø It was created by Linus Torvalds in 2005.

Ø GitHub is a website and cloud-based service.

Ø It is a distributed version control system, and free and open-source distributed version control system.

Ø It designed to handle everything from small to very large projects with speed and efficiency.

Main benefits of using GitHub

· GitHub is a repository

· Integration options

· easier to get excellent documentation.

· easy to contribute to your open-source projects

· Showcase your work

Features of Git

· Collaboration.

· Integrated issue and bug tracking.

· Graphical representation of branches.

· Git repositories hosting.

· Project management.

· Team management.

· Code hosting.

· Track and assign tasks

Git Commands

· git init : Initialize a local Git repository

· git status : Check status

· git add [file-name.txt] : Add a file to the staging area

· git add -A : Add all new and changed files to the staging area

· git rm -r [file-name.txt] : Remove a file (or folder)

· git branch [branch name] : Create a new branch

· git branch -d [branch name] : Delete a branch

· git push origin — delete [branch name] : Delete a remote branch

· git branch [branch name] : Create a new branch

· mkdir store : Create a directory if not created initially

A step-by-step guide to Git

Step 1: First we Create a GitHub account.

Step 2: Then we Create a new repository.

Step 3: After that we Create a file in git-hub.

Step 4: Then we Make a commit.

Step 5: Connect your GitHub repo with your computer.

Press enter or click to view image in full size