Skip to main content

Java Programming Basics to Brilliance Part 1



Let's get our hands dirty with Java Application Development. By the end of this course, you will be able to understand and code in Java programming language. We will also be making some real-life application which I haven't yet decided.
Now, I know there are just too many sites out there which can teach you Java and probably far better than what I am writing here. So what am I gonna do here which is different from them? Nothing.
I am only going to repeat what you have probably already read. But I will keep it short and try to make it as easy as possible.
This is part one, and I haven't planned as for how many parts this series will have.
This tutorial is meant for complete beginners to the Programming world. This will get you an idea of how programming(not just Java) works in the shortest possible way.

Useful links: 
This is my way of tracking my progress. 

First of, 
What is Java?
  1. Java is an OOP based programming language. OOP stands for Object-Oriented Programming. Defined further ahead.
  2. You can make cross-platform(including mobile) applications using Java. 
  3. You can make web applications using Java.
How do Java works?
Broadly
  1. Java code is written by a developer.
  2.  The compiler reads the complete code and generates a .class file which contains the bytecode.
    This .class file is like the instructions for JVM defined next.
  3. JVM, stand for Java Virtual Machine takes the .class file and does whatever it says.
The step 2-3 results in Java being platform independent. JVM is a system specific software and every different kind of system will have a different kind of JVM. 

Things you will need.
I will simplify this for you in one step, just install Eclipse IDE. Download it from here. It will help you setup rest.

To mention is any way you will need to download JDK(Java Development Kit) from Oracle website here. Set the environment variables to run Java files through command prompt or link JDK folder in Eclipse. That's it. 

What is OOP?
Given that we are learning an OOP based programming language it's natural to ask what actually is OOP? 
Object Oriented Programming is a concept of programming in which we deal and do anything and everything by creating objects.
Objects are like real-world entities in the program. Like any object in real life will have certain characteristics, objects in a program is expected to carry some attributes. Like any object in real life can do something, objects in a program can also do something. For example, an Object like myDog has a dogTail as an attribute and myDog can wag his dogTail.

OOP can always be achieved with the 4 features, namely 
Abstraction: which is hiding of details from the viewer. Like f I want to feed myDog I don't need to know how his digestive system works I just have to offer myDog his food.
Encapsulation: which is binding up of certain feature and features to limit their scope of functionality. We use access modifiers like Public, Private, Protected and Default to achieve this. For example, if myDog is Public anyone can pet him, but if myDog is private and not allowed to move out of the home, only the people inside the home can pet him.
Inheritance: which is carrying the similar attributes like that of their parent. This reduces the amount of code written and makes it easier to understand. For example, if myDog has a myPuppy he will carry similar attributes like Tail, Eyes, Ears.
Polymorphism: which is different behaviour performed by the object in different situations. For example, myDog will walk slowly when I take him for a walk but run away when I let him. So the feature is same which is move() but mydog can either walk or run depending on the situation.

Java Syntax
Every language in this world has a syntax so does a programming language like Java.

Continued further here.


Comments

Popular posts from this blog

Unity Mobile Game Optimization Checklist

- On Image and Text components that aren’t interacted with you can uncheck “Raycast Target” on it, as it will remove them from any Raycast calculus. - Click on your textures in your “Project” window. Click on the “Advanced” arrow, and now check “Generate Mip Maps”, Unity especially recommends it for faster texture loading time and a lower rendering time. - Set the “Shadow Cascades” to “No Cascades” (Quality settings) - If you have dynamic UI elements like a Scroll Rect with a lot of elements to visualize, a good practice is to turn off the pixel perfect check box on the canvas that contains the list and disable the items that aren’t visible on the screen. - Set all non moving objects to "Static" - Above Unity3d 2017.2 you should turn off "autoSyncTransforms" on the Physics tab - Always use Crunch Compression Low on textures - Try to keep the “Collision Detection Mode” on “Discrete” if possible, as “Dynamic” demands more performance. - You can go to the TimeManager w...

How to make RPC in Unreal Engine Steam Online Subsystem and EOS

Remote Procedure Calls, also known as RPCs, are a way to call something on any other instance.  In the Unreal Engine, RPCs are used to ship events from the patron to the server, the server to the customer, or from the server to a specific group. It's important to word that RPCs cannot have a return cost. If you want to return something, you'll ought to use a seconds RPC within the contrary path. There are precise policies that RPCs observe, which are unique in the official Documentation. Some of these regulations encompass wherein the RPC must be run, such as the server instance of an Actor, on the owner of the Actor, or on all instances of the Actor. There are some necessities for RPCs. First, they must be referred to as on Actors or replicated Subobjects. The Actor (and component) have to additionally be replicated. If the server is looking an RPC to be executed on a customer, handiest the patron who owns that Actor will execute the function. Similarly, if a client is calling...

How to drag and drop item in Unity3D

  For dragging and dropping to work we will need to first grab the Game Object and ensure while the Game Object remains grabbed it's position reciprocates the mouse position. This will work fine for not only PC bug mobile devices as well. First define GameObject which we will be dragging. public GameObject selectedPiece; Now inside Update method we will give reference to touched/clicked object and while there is a reference available to an game object(selectedPiece;) we will move that object to mouse position. When the reference is remove, object won't move therefore dropped. void Update(){ RaycastHit2D hit = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero); if (Input.GetMouseButtonDown(0)){ if(hit.transform != null)             {                 if (hit.transform.CompareTag("PIECE"))                 {     ...