Skip to main content

Posts

What is a java HashMap and How it works ?

What is a java HashMap and How it works ? What is a HashMap ?             The HashMap in Java is one of the most popular Collection class among Java programmers. The HashMap is a data structure, based on hashing, which allows you to store an object as key value pair, an advantage of using HashMap is that you can retrieve object on constant time i.e. O(1) if you know the key. The HashMap class implements Map interface and supports Generics from Java 1.5 release, which makes it type safe. There are a couple of more Collections, which provides similar functionalities like HashMap, which can also be used to store key value pair. Hashtable is one of them, but Hashtable is synchronized and performs poorly in a single threaded environment. one relatively new is ConcurrentHashMap, which provides better performance than Hashtable in a concurrent environment and should be preferred. How HashMap works ?             In Hashmap objects are stored by calling   put(key, value)   method o
Recent posts

An Introduction to Spring Framework

An Introduction to Spring Framework   What is Spring ? Spring is an application framework . Unlike single-tier frameworks such as Struts or Hibernate, Spring aims to help structure whole applications in a consistent, productive manner, pulling together best-of-breed single-tier frameworks to create a coherent architecture. Why Spring ? The Spring Framework is an open source application framework that aims to make J2EE development easier. We’ll look at the motivation for Spring, its goals, and how Spring can help you develop high-quality applications quickly. Using J2EE “out of the box” is not an attractive option. Many J2EE APIs and services are cumbersome to use. J2EE does a great job of standardizing low-level infrastructure, solving such problems as how can Java code access transaction management without dealing with the details of transactions. But J2EE does not provide an easily usable view for application code.That is the role of an application framework, such a

Tour Management System - 2nd year ITP project

   Introduction to the System  The Lotus Tours Company which is located in Nugegoda, provides a good service to the customers who wish to visit sacred places in India and Thailand. India and Thailand are some beautiful countries in Asia. A trip to these countries can reveal numerous mystic things regarding its culture, art tradition history etc. Any person who wish to travel through the Lotus Company are allowed. Even the customers who doesn’t have a passport can reserve a date and get registered. Company will get all the details from the customer who doesn’t have a passport and help to prepare a new passport for them They have many packages in different prices. To get registered every customer should deposit Rs. 10,000 in advance. Then the rest of the amount are paid in installments prior to the tour date or the full amount for the tour can be paid at once. When a customer make a reservation, all the reservation details are recorded in a file and unique ID number is given to

Apache Maven

Introduction to Apache Maven   What is maven? Maven is a project management tool which encompasses a project object model, a set of standards, a project life cycle, a dependency management system, and logic for executing plugin goals at defined phases in a life cycle. When you use Maven, you describe your project using a well-defined project object model, Maven can then apply cross-cutting logic from a set of shared (or custom) plugins. The great majority of Maven users are going to call Maven a “build tool”: a tool used to build deployable artifacts from source code. Build engineers and project managers might refer to Maven as something more comprehensive: a project management tool. What is the difference? A build tool such as Ant is focused solely on preprocessing, compilation, packaging, testing, and distribution. A project management tool such as Maven provides a super set of features found in a build tool. In addition to providing build capabilities, Maven can also ru

Liscov Substitution principle

Liscov Substitution Principle  Inheritance is one of the important OOP concept. Liscov Substitution Principle is applied when using inheritance in our program. We must make sure that the child classes just extend without replacing the functionality of parent class. Otherwise the child classes can produce undesired effects when they are used in existing program modules. child component must be completely substitutable for their parent components . As an example if we take the classes " Rectangle" and "Square" In mathematics square is also a kind of rectangle. which makes the square class a child of rectangle class. rectangle class has some methods and they might be over ridden by the square class. if we have a function draw() and we do not know what shape will be returned but it will surely be a rectangle. If we give the length = 10 cm and width = 5 cm violating the Liscov Substitution principle is when the first length entered will be taken as the length of

What is AngularJS and How it works ?

What is AngularJS and How it works ? What is AngularJS ?                         Definition of AngularJS as put by its official documentation is as follows: “ AngularJS is a structural framework for dynamic web apps. It lets you use HTML as your template language and lets you extend HTML’s syntax to express your application’s components clearly and succinctly. Angular’s data binding and dependency injection eliminate much of the code you currently have to write. And it all happens within the browser, making it an ideal partner with any server technology.” AngularJS is a JavaScript MVC Framework that integrates two-way data binding, Angular does one very specific job very well – that is, moving data around inside a single-page application, dynamically updating the view as the data changes without the need for specific listener code. If you have a website where this type of functionality is important (there’s more and more of them now) then it might fit the bill for you. How A