A way to ease your RAM

The process of imposing type constraints at compile-time and discard the element type information at runtime.

In the other words, the compiler replaces a generic parameter with the actual class or bridge method. moreover, the compiler ensures that no extra classes are created and there is no runtime overhead.

In fact, type erasure ensures your code to be compatible with older versions of java which may not contain generics at all.

Flowers flower = sample.emptyBucket();

the compiler will turn the above code in a casted way.

Flowers flower = (Object) sample.emptyBucket();

  • Backward compatibility in Two-way
  • Much easier to implement


Lambda expressions and Functional programming are considered as the cornerstones of the Java 8 .

what is a Lambda Expression?

simply a block of logic that get passed around , like an anonymous method.

What is a Functional Interface?

simply a functional interface is an interface with a single abstract method.

Functional interfaces are used as the basis of the lambda expression and that is how functional interface technically related to the lambda expressions.

How compiler works on making Functional Interfaces

Java compiler is smart enough to take any interface with a single abstract method as a functional interface.

In…


Understanding Data Preprocessing

I thought of dating machine learning for my personal interest. As a beginner, I would recommend you to start with Data Preprocessing. In this article, I am going to make you familiar with the Data preprocessing tools.

Let’s give this a go…

For the past few days, I have been getting exposed to a new language which is R and literally with the sibling, Python.

If you have prior experience in ML there is no harm using Jupytor Notebook or Spyder or maybe with your classic terminal. First, you will have to get ready with the Anaconda platform installed on…


Transferring Files to Your EC2 and Capturing Network Traffic

Photo by Thomas Jensen on Unsplash

NOTE…!

This is a continuation of the practical Capturing Network Traffic: Amazon EC2 Instance #1. Please have a read on that first and continue to this article.

In this article, I will be using FileZilla to transfer files from my Mac (having macOS Catalina) over to the Amazon EC2 I created in my previous article above. Then I will be using Telnet to connect to the server I deploy on the EC2 and Wireshark to capture the network traffic on calls to the server.

Step 1 — Transferring Files to Your EC2 with FileZilla

  1. Open FileZilla and go to Settings from the Menu bar.


Steps to Creating an Amazon EC2 Instance

Photo by Christina @ wocintechchat.com on Unsplash

I thought of writing this story from scratch to implement the practical on macOS Catalina.

Let’s get our hands dirty…

I will be using my AWS Educate account for this tutorial.

Step 1 — Create an EC2 Instance in AWS Educate

Creating the EC2 instance is done on the AWS platform. So the tasks you carry out in this Step 1 do not differ from what Operating System you are on.

Login to your AWS educate account as follows


A Look Into the Behaviour of the Java Compiler

Photo by Christopher Gower on Unsplash


lets create a function to search a node…

This function takes in a parameter which we intended to search.

by creating an endless loop we can do the finding process until we find the correct node

while(true){

// body

}


First let me introduce what is a binary tree.

  • The left subtree of a node contains only nodes with keys lesser than the node’s key.
  • The right subtree of a node contains only nodes with keys greater than the node’s key.
  • The left and right subtree each must also be a binary search tree.

Create a node class


Constructors don’t have a return type and they should be as the same as the class name.

Constructors are used to initialize the object’s state.

When is a Constructor called ?
Each time an object is created using new() keyword at least one constructor (it could be default constructor) is invoked to assign initial values to the data members of the same class.

A constructor is invoked at the time of object or instance creation.

Rules of writing a constructor:

>Constructor(s) of a class must has same name as the class name in which it resides.

>A constructor in Java…


In java program, it’s not crucial a class to be a public class.Meanwhile in a single java file there can be several classes defined and among them there can be only one class to a public class.

lets take an example…

This implies that If there is a public class in a java file the file should be named as

<public Class name>.java

Rajitha Bandara

Tech enthusiast…</>

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store