Posts

Showing posts from December, 2018

Sat Dec 29 10:02:40 PST 2018

If you have just started learning Java and came from C background then you might have noticed some difference between Java and C programming language e.g. String is an object in Java and not a NULL terminated character array. Similarly, there is is no sizeof() operator in Java. All primitive values have predefined size e.g. int is 4 bytes, char is 2 byte, short is 2 byte, long and float is 8 byte and so on. But if you are missing sizeOf operator then why not let's make it a coding task? If you are Ok, then your next task is to write a method in Java, which can behave like sizeOf() operator/function of C and returns size in bytes for each numeric primitive types i.e. all primitive types except boolean. This week?s task is to implement binary search in Java, you need to write both iterative and recursive binary search algorithm . In computer science, a binary search or half-interval search is a divide and conquer algorithm which locates the position of an item in

Sat Dec 29 09:02:08 PST 2018

To be honest with you, getting your first job is never easy. It is, in fact, the hardest task and you need to put your best effort to find a job in your dream company. Most of the computer science graduates dream of working for Google , Facebook , Amazon , Microsoft , and Apple but they often not able to clear their rigors coding interviews. The single most important reason for failing those coding job interviews is lack of knowledge and practice, hence it becomes increasingly important that you prepare hard in advance. Unfortunately, I learned this little too late, after spoiling my chances at Microsoft and Amazon but you can learn from my experience and prepare better for your programming job interviews. Hello guys, I have been sharing some REST with Spring tutorials from last a couple of weeks and today, I am going to share some of the frequently asked Spring and REST interview questions to Java developers applying for Web developer roles. Since Spring Framework is th

Sat Dec 29 08:01:37 PST 2018

The Object-Oriented Design Principles are the core of OOP programming, but I have seen most of the Java programmers chasing design patterns like Singleton pattern , Decorator pattern or Observer pattern, and not putting enough attention on learning Object-oriented analysis and design . It's important to learn basics of Object-oriented programming like Abstraction, Encapsulation, Polymorphism, and Inheritance. But, at the same time, it's equally important to know object-oriented design principles, to create the clean and modular design. I have regularly seen Java programmers and developers of various experience level, who either don't hear about these OOP  and SOLID design principle, or simply doesn't know what benefits a particular design principle offers, or how to apply these design principle in coding.  Hello guys, today, we'll talk about design patterns and some of the best online courses to learn design patterns in Java from scratch. If you are

Sat Dec 29 07:02:46 PST 2018

If you are a Java developer and looking for some awesome resources e.g. books and courses to improve your multi-threading and concurrency skills in Java then you have come to the right place. In the past, I have shared books and tutorials on Java Concurrency and Multithreading and in this article, I am going to talk about some of the best free and paid course to learn multi-threading and concurrency in Java. You can join these free courses to improve your understanding of Java Concurrency and Multithreading. It's one of the most important skills for Java developers as almost all the companies who interviews Java developers pay particular attention to his knowledge and experience in this area. How to avoid deadlock in Java? is one of the popular Java interview question and flavor of the season for multi-threading, asked mostly at a senior level with lots of follow up questions. Even though question looks very basic but most of the Java developers get stuck once you st

Sat Dec 29 06:02:41 PST 2018

Hello guys, this is my first article in Java 9 features on this blog and today you'll learn about my favorite feature "factory methods for collection" , which is introduced as part of JEP 269. The JEP stands for JDK enhancement proposal. If you have worked in Groovy or Kotlin then you know that how easy is to create the list with elements using collection literals e.g. to create a list of 1, 2, 3 you can simply write val items = listOf(1, 2, 3) . Unfortunately, Java doesn't support that yet but things have been improved with the factory methods for collection in JDK 9 and it's almost like that. JDK has added static factory methods like of()  on to basic Collection interfaces which you can use to create a list of items. One of the common problem while removing elements from an ArrayList in Java is the ConcurrentModificationException. If you use classical for loop with the index or enhanced for loop and try to remove an element from the ArrayList u

Sat Dec 29 05:02:12 PST 2018

Hibernate is one of the most popular, open source O RM (Object Relational Mapping) framework, which has now become a standard for developing persistence layer on Java enterprise application, along with JPA (Java Persistence API). I often receive requests to suggest which book is best to learn to hibernate or recommendation about some good books and training course on Spring and Hibernate . This motivates me to write this article about some of the best books on Hibernate currently available on the market. Earlier I have shared some of the must-read books on Spring framework for a Java developer, which is quite helpful for picking a book on Spring. Similar to Spring framework, experience in Hibernate is most sought after thing in Java JEE   development roles. Hibernate is one of the essential frameworks for Java and Java EE or JEE programmers, especially if you are working on the server side of a Java web development project. It's an ORM tool or a framework which

Sat Dec 29 04:01:39 PST 2018

If you are a Java developer, working in Spring framework and thinking to become a certified Spring professional but couldn't to do it in the past due to expensive mandatory training provided by Pivotal and its partners then there is a good news for you. From 10th May 2017, Pivotal made the Spring Core training optional for appearing to Spring certification exam, which means, now, it's not mandatory to take Spring training for Spring certifications (see here ). Similar to Oracle's Java certifications, you can become a Pivotal certified Spring Professional by just buying the exam vouchers and scheduling your exam online using examlocal.com from anywhere in the world. If you are a Java Spring developer and working with Spring Security then you may be familiar with the "Learn Spring Security" course by Eugen Paraschiv of Baeldung.com. It is one of the most advanced and comprehensive courses on Spring Security and the best part of this course is that Eugen

Sat Dec 29 03:02:08 PST 2018

"Can a non-static method access a static variable or call a static method" is one of the frequently asked questions on static modifier in Java, the answer is, Yes , a non-static method can access a static variable or call a static method in Java. There is no problem with that because of static members i.e. both static variable and static methods belongs to a class and can be called from anywhere, depending upon their access modifier. For example, if a static variable is private then it can only be accessed from the class itself, but you can access a public static variable from anywhere. Similarly, a private static method can be called from a non-static method of the same class but a public static method e.g. main() can be called from anywhere. How to remove all unused imports in Eclipse Eclipse IDE gives warning "The import XXX is never used" whenever it detects unused import in a Java source file and shows a yellow underline. Though u

Sat Dec 29 02:01:38 PST 2018

There is no doubt that JavaScript is the most popular programming language at this moment and it's also confirmed by StackOverFlow's 2018 Survey. You can build static websites, web applications, native mobile applications (yes you can do that too), desktop applications and even server-side application in JavaScript . It also makes you hundred time more employer as there are tons of web development jobs out there. Becuase of that ore and more developers are learning JavaScript to become a web developer. One of my goals in 2018 is to learn and master Git and I have been searching some good tutorials and courses to start with. The Internet is full of git tutorials and a simple Google search will leave you thousands of tutorials but the big question mark is where do you start? It's easy to pick a tutorial or a blog post if you have some background about what is Git, what it does? and how to use it but if you don't have much background then you need a course which

Sat Dec 29 01:02:39 PST 2018

There is no doubt that JavaScript is the most popular programming language at this moment and it's also confirmed by StackOverFlow's 2018 Survey. You can build static websites, web applications, native mobile applications (yes you can do that too), desktop applications and even server-side application in JavaScript . It also makes you hundred time more employer as there are tons of web development jobs out there. Becuase of that ore and more developers are learning JavaScript to become a web developer. One of my goals in 2018 is to learn and master Git and I have been searching some good tutorials and courses to start with. The Internet is full of git tutorials and a simple Google search will leave you thousands of tutorials but the big question mark is where do you start? It's easy to pick a tutorial or a blog post if you have some background about what is Git, what it does? and how to use it but if you don't have much background then you need a course which

Sat Dec 29 00:02:43 PST 2018

There is no doubt that JavaScript is the most popular programming language at this moment and it's also confirmed by StackOverFlow's 2018 Survey. You can build static websites, web applications, native mobile applications (yes you can do that too), desktop applications and even server-side application in JavaScript . It also makes you hundred time more employer as there are tons of web development jobs out there. Becuase of that ore and more developers are learning JavaScript to become a web developer. One of my goals in 2018 is to learn and master Git and I have been searching some good tutorials and courses to start with. The Internet is full of git tutorials and a simple Google search will leave you thousands of tutorials but the big question mark is where do you start? It's easy to pick a tutorial or a blog post if you have some background about what is Git, what it does? and how to use it but if you don't have much background then you need a course which

Fri Dec 28 23:02:39 PST 2018

There is no doubt that JavaScript is the most popular programming language at this moment and it's also confirmed by StackOverFlow's 2018 Survey. You can build static websites, web applications, native mobile applications (yes you can do that too), desktop applications and even server-side application in JavaScript . It also makes you hundred time more employer as there are tons of web development jobs out there. Becuase of that ore and more developers are learning JavaScript to become a web developer. One of my goals in 2018 is to learn and master Git and I have been searching some good tutorials and courses to start with. The Internet is full of git tutorials and a simple Google search will leave you thousands of tutorials but the big question mark is where do you start? It's easy to pick a tutorial or a blog post if you have some background about what is Git, what it does? and how to use it but if you don't have much background then you need a course which

Fri Dec 28 22:02:39 PST 2018

There is no doubt that JavaScript is the most popular programming language at this moment and it's also confirmed by StackOverFlow's 2018 Survey. You can build static websites, web applications, native mobile applications (yes you can do that too), desktop applications and even server-side application in JavaScript . It also makes you hundred time more employer as there are tons of web development jobs out there. Becuase of that ore and more developers are learning JavaScript to become a web developer. One of my goals in 2018 is to learn and master Git and I have been searching some good tutorials and courses to start with. The Internet is full of git tutorials and a simple Google search will leave you thousands of tutorials but the big question mark is where do you start? It's easy to pick a tutorial or a blog post if you have some background about what is Git, what it does? and how to use it but if you don't have much background then you need a course which

Fri Dec 28 21:03:05 PST 2018

There is no doubt that JavaScript is the most popular programming language at this moment and it's also confirmed by StackOverFlow's 2018 Survey. You can build static websites, web applications, native mobile applications (yes you can do that too), desktop applications and even server-side application in JavaScript . It also makes you hundred time more employer as there are tons of web development jobs out there. Becuase of that ore and more developers are learning JavaScript to become a web developer. One of my goals in 2018 is to learn and master Git and I have been searching some good tutorials and courses to start with. The Internet is full of git tutorials and a simple Google search will leave you thousands of tutorials but the big question mark is where do you start? It's easy to pick a tutorial or a blog post if you have some background about what is Git, what it does? and how to use it but if you don't have much background then you need a course which

Fri Dec 28 20:03:15 PST 2018

Image
Beginning in Android 3.0, using the SearchView widget as an item in the action bar is the preferred way to provide search in your app. Like with all items in the action bar, you can define the SearchView to show at all times, only when there is room, or as a collapsible action, which displays the SearchView as an icon initially, then takes up the entire action bar as a search field when the user clicks the icon. Create your menu.xml as following. &ltmenu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" tools:context=".UploadActivity"&gt &ltitem android:id="@+id/search" android:icon="@android:drawable/ic_menu_search" app:actionViewClass="android.support.v7.widget.SearchView" android:title="@string/action_search" app:showAsAction=&?

Fri Dec 28 19:57:34 PST 2018

Image
Beginning in Android 3.0, using the SearchView widget as an item in the action bar is the preferred way to provide search in your app. Like with all items in the action bar, you can define the SearchView to show at all times, only when there is room, or as a collapsible action, which displays the SearchView as an icon initially, then takes up the entire action bar as a search field when the user clicks the icon. Create your menu.xml as following. &ltmenu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" tools:context=".UploadActivity"&gt &ltitem android:id="@+id/search" android:icon="@android:drawable/ic_menu_search" app:actionViewClass="android.support.v7.widget.SearchView" android:title="@string/action_search" app:showAsAction=&?

1546053032

Image
Install MEAN Stack Using CloudFormation AWS CloudFormation is a service that helps you model, setup and replicate your AWS resources. It uses a template file to bring up a collection of resources together as single stack. To create templates we use a JSON file or AWS CloudFormation Designer . For this tutorial I opted the first solution. Note : The template is available on my Github  ðŸ˜Ž. We start with a basic template that defines a single EC2 instance with a security group that allows SSH traffic on port 22 , MongoDB traffic on port 27017 , and the NodeJS app on port 3000 from anywhere , as shown below: stack.json { "AWSTemplateFormatVersion" : "2010-09-09", "Description" : "Create an EC2 instance with MEAN stack installed", "Parameters" : { "InstanceType" : { "Description" : "EC2 Instance type"