As a developer, it is extremely important to understand how memory management in java works. It can help avoid creating difficult to trace problems. This blog post would give a simplistic view of memory management in java. With respect to memory management of Java applications, you need to understand two terms, the stack and the heap. The memory … Continue reading How memory works in Java?
Author: Anjana Shankar
Java Strings
String literals and String Objects String s1 = "abc"; String s2 = "abc"; Both string s1 and s2 refer to the same string object and value residing in the string literal pool. String A = new String("abc"); String B = new String("abc"); The two strings A & B are two different string objects, because we … Continue reading Java Strings
Java Static Initialization vs. Instance Initialization – When to use which?
Static Initialization Typically static initialization block is used to initialize static variables of a class. The block is called at the time of class initialization. It is called only once. You can initialize static variables inline. If more complicated logic is required for initialization, a static initialization block can be used. The static initialization blocks … Continue reading Java Static Initialization vs. Instance Initialization – When to use which?
Do you ssh too often and to many different machines?
It's been a long time, since I last wrote a post. And this is going to be a short one. At my recent job, we have all these test environments (about 3500 of them) that have the same username and password. I kind of got tired typing the username and password every time I had … Continue reading Do you ssh too often and to many different machines?
10 Intellij Idea Must Know Shortcuts on Ubuntu
Optimizing imports - Ctrl + Alt+ O Auto Imports - Alt+enter System.out.println - type sysout, then press tab Open a file - Ctrl+N GoTo Function in class - Ctrl + F12 Auto Indent - Ctrl + Alt + I Basic Code Completion - Ctrl + Space Comment a line of code - Ctrl + / … Continue reading 10 Intellij Idea Must Know Shortcuts on Ubuntu
Mount a Remote system as a drive on OSx using SSH
Recently I ran into a situation where I needed to mount a remote system folder on my OSx for ease of sharing and convenience. You can totally do without this by just using the terminal. However, writing this hoping to help those who need to do this for one or the other reason. 1. Install … Continue reading Mount a Remote system as a drive on OSx using SSH
Accessing Solr Cloud on AWS from SolrJ
We have a Solr cloud installation on AWS EC2 instances. We use the SolrJ Client from our Java application. Till date we used to have a Solr Cloud installation on our local machine in order to test the code against. As the team started growing, we realized that we should have a way to access … Continue reading Accessing Solr Cloud on AWS from SolrJ
Managing Multiple Github Accounts from a single machine
Recently, I ran into a situation where I needed to manage multiple Github accounts from a single computer. I have two github account, one related to work and the other for my personal repositories.It is a very simple combination of ssh and git config. Before I start explaining the steps for the same, let me … Continue reading Managing Multiple Github Accounts from a single machine
Interfaces in Java8
Interfaces are a key feature of object oriented programming. An interface provides a set of methods that an implementing class must provide. One can assign instances of the class to variables of the interface type. As of Java8, an interface can contain default methods that an implementing class can inherit or override. Default methods (also … Continue reading Interfaces in Java8
Database Indexing Basics
Database Indexing allows us to cut down the number of rows/records that need to be examined when a select query with a where clause is executed.Let's try to understand what happens when a select query is executed on a database table without an index.Suppose we have an Employee table, with fields 'Employee_Id' and 'Employee_Name'. We … Continue reading Database Indexing Basics
You must be logged in to post a comment.