Posts

Hello World in Unicode - java

\u0070\u0075\u0062\u006C\u0069\u0063\u0020\u0063\u006C\u0061\u0073\u0073\u0020\u0055\u006E\u0069\u0057\u0072\u006C\u0064\u007B\u0070\u0075\u0062\u006C\u0069\u0063\u0020\u0073\u0074\u0061\u0074\u0069\u0063\u0020\u0076\u006F\u0069\u0064\u0020\u006D\u0061\u0069\u006E\u0028\u0053\u0074\u0072\u0069\u006E\u0067\u005B\u005D\u0020\u0061\u0029\u007B\u0053\u0079\u0073\u0074\u0065\u006d\u002E\u006F\u0075\u0074\u002E\u0070\u0072\u0069\u006E\u0074\u006C\u006E\u0028\u0022\u0048\u0065\u006C\u006C\u006F\u0020\u0077\u006F\u0072\u006C\u0064\u0022\u0029\u003B\u007D\u007D Save the content in UniWrld.java and execute it. It will print Hello World. According to java language specification java compiler parses the source code in unicode characters. So if we can write the entire program in unicode alone.  See the following code and guess the output. public class HelloWorld  { public static void main(String[] args)  { // \u000d System.out.println("Hello world"); } ...

The evolution of Lambda

Hi Guys,              Let us look at the behavioral parameter pattern, the base of lambda function and the evolution of  lambda function. Change is inevitable. Requirements do change. It is the ability of the software to respond well that makes it stand out in the crowd. Behavioral parameter pattern lets us handle frequent changes in the most beautiful way. Let us discuss with an example. Requirement: We have a list of employees. We want to filter only full time employees. How can we write java code for this. Solution 1:  public List<Employee> filterFulltimeEmployee(List<Employee> employees) { List<Employee> filteredEmployees = new ArrayList<>(); for(Employee employee : employees) { if(employee.isFulltimeEmployee) filteredEmployees.add(employee); } return filteredEmployees; } Fine. Now instead of full time employees, we need part time employees. A naive solution would be ...

A warm welcome

Hi Everyone,       This blog is created with an idea of improving the quality of my code as well as yours. Here I will post my code and ideas and I greatly appreciate your comment on how to improve my code. Similarly you can comment your code and I will share my views on the same. Further we will discuss different ideas and topics in different genre. So stay tuned and provide your valuable support and feedback. Regards, A S Balaji.