Skip to main content

Posts

Showing posts from July, 2019

Chatting Application | Demo Project | Learn Java

How to make a simple chatting application Java Web? REQUIREMENT Simple chat application. Users can register their names to the application. After login, the user can find any registered friend and start a chat. If a user had previous chat with a selected friend, it should load in chat view. Sent messages and received messages must show without affecting the chat page. ASSUMPTIONS for DEMO PROJECT Usernames do not duplicate. Register different names, login, and chat with others. No need of sending pictures, videos, etc. Just create a text message chat. This demo project is not about user registration, login, file uploading… etc. This demo project is about chatting between two users and how to keep and update chats using a data structure. IMPROVEMENTS Develop better user registration and login system with generating unique user ids to avoid duplicate issues. Develop privilege management for users. Develop chat that can send images, videos too. OPTIONAL Do not use MYSQL or any other DBMS...

Session Cart | Demo Project | Learn Java

HTTP Session Cart practical REQUIREMENT An online selling company needs a solution for their web application that they want to keep product details that are willing to purchase by users. The product list that the user is willing to purchase is called a cart. The cart must view each user with details and temporary. The cart will be clear when the user has closed the browser or automatic session timeout because this company does not want to keep details in the cart when the user left without purchasing at the moment. KNOWLEDGE NEED HTTP Session. An HTTP session is a temporary object that provides by the server when a user is requesting something from a web application/ site. If ten users (anywhere in the world) are requesting the same web application/ site, the server makes ten HTTP sessions for each user. So HTTP session is a unique object for a user. JSP is also known as the java server page. JSP is a server-side programming technology that helps to create dynamic HTML content, m...

Single Linked List | Demo Project | Learn Java

How to program a collection of data without using any array or list? This is an earlier way to keep the collection of data. There are some special points in the structure of a linked list. A linked list is made by keeping objects called “nodes”. There are two partitions in a single node. Data and Link. This is a must. Every node must have these two partitions. The data partition is used to keep user data. We can use generic type to keep the same data type or change as required. We can keep any data type if we use an object as the generic type. Link partition is used to keep the link to the next node. As a structure, every node has data and links to the next node. The last node of the linked list is linked to the null node. Every linked list has a head. Also known as the first node of the linked list. When we want to read data. We have to start from the first node and loop next. We want to start from the head(first node) and next (second node) and next (third node) if we want t...

Iterator Pattern | Demo Project | Learn Java

PRACTICAL USAGE of ITERATOR PATTERN in JAVA Requirement There is a restaurant called "big mama restaurant" which provides Italian meals and Chinese meals. They provide Italian and Chinese meals in the separate menu list. Not in the same Menu. They have only five Chinese meals. A meal has details such as type (vegetarian or non-vegetarian), name, description, and price. There is a waiter in the restaurant who reads the Italian and Chinese food menu when required. The waiter reads only one Italian or Chinese menu at once as required. Pre-required knowledge of, Objects, Arrays, and Arraylist. Java class, interface, and inheritance. Encapsulation. Abstract methods and overriding. Basic loop. And, Make Chinese menu as an Array. Make Italian menu as an Arraylist. Users can add meals to each menu list. Give a solution to this waiter to read each menu. Major steps before that need to think before and while, 1) Create meals and a menu Create a class called meal which has fields c...