Strategy Pattern

This pattern is listed in Behavioral pattern which allows you to define sets of algorithms in the parent class which will be extended by sub classes in which all the given algorithms are interchangeable. The best way to observe this pattern is to study the below example. public abstract class Employee { public abstract int

installing oracle jdk 8 on ubuntu

tar zxvf jdk-8u151-linux-x64.tar.gz sudo mkdir /usr/java sudo mv jdk1.8.0_151/ /usr/java sudo update-alternatives –install “/usr/bin/java” “java” “/usr/java/jdk1.8.0_151/bin/java” 1 sudo update-alternatives –install “/usr/bin/javac” “javac” “/usr/java/jdk1.8.0_151/bin/javac” 1 sudo update-alternatives –install “/usr/bin/javaws” “javaws” “/usr/java/jdk1.8.0_151/bin/javaws” 1 fix the permissions sudo chmod a+x /usr/bin/java sudo chmod a+x /usr/bin/javac sudo chmod a+x /usr/bin/javaws sudo chown -R root:root /usr/java/jdk1.8.0_151 sudo nano /etc/environment and

Passing objects between managed beans&controllers

in the source controller add your object into faces session map interface and identify it with a name FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("category", category); then in the target controller to acquire the object do the following Category category = (Category) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("category");

Collections Example

I was wondering new features in Java 8 and wanted to play around with Lambda expressions. So I’ve eventually ended up preparing some collection examples. Hope you’ll easily summarize and understand it The Code package com.oracle.lambda; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.function.Predicate; public class CollectionExample { public static void main(String[] args) { List<Developers>

Interfaces Versus Abstract Classes

While you use an interface to specify the form that something must have, it does not actually provide the implementation for it. In this sense, an interface is a like an abstract class. The abstract class must be extended in exactly the manner that its abstract methods specify. An interface differs from an abstract class

Getting current server name

// BO necessary util classes and defining instances for each class IInfoStore boInfoStore = null; IInfoStore boInfoStore2 = null; IInfoObject boIInfoObject = null; IInfoObject boIInfoObject2 = null; IInfoObjects boInfoObjects = null; IInfoObjects boInfoObjects2 = null; SDKException sdkException = null; IEnterpriseSession boEnterpriseSession = null; IPluginMgr boPluginMgr; IPluginInfo boPluginInfo; IUser boCurUser = null; IUserGroup boGroup = null;