This tutorial explains the equals() and hashcode() method in simple terms. It is one of the confusing questions on the Java developer’s mind. The common questions asked about these methods are: What is equals() method and why should I override that in our classes? What is hashcode() method? Why should I always override hashcode() when …
Core Java
Java Immutable Objects
Objects whose state can’t be changed after its creation are called immutable objects. It is considered an effective strategy to make objects immutable if they are going to be used in multithreaded applications. Java’s built-in Strings, Integers are all immutable objects and so there must be some solid reasoning behind that. In this article, lets …
How to use Socket API for creating Client-Server application in Java
In this example we make use of ServerSocketChannel and SocketChannel to create a simple Echo application where in the Server would print the data sent by the client. also read: Java Tutorials Java EE Tutorials Design Patterns Tutorials Java File IO Tutorials The code is explained with the required comments: and the client which connects …
Download file from HTTP & HTTPS server using Java
In the earlier articles, JavaBeat has published many articles on uploading and downloding of files using the Java programming. Upload and Download is essential utility in the programming world because every server must have the feature to upload and download the files by the user or downlod the reports incase of the enterprise applications. The …
Stochastic Gradient Ascent
This article is based on Machine Learning in Action , published on February 2011. It is being reproduced here by permission from Manning Publications. Manning publishes MEAP (Manning Early Access Program,) eBooks and pBooks. MEAPs are sold exclusively through Manning.com. All pBook purchases include free PDF, mobi and epub. When mobile formats become available all …
What is Immutable Objects in Java?
An immutable object is something whose state can’t be change after there creation, e.g. String objects. Once you have created a String object, you can’t alter this. Creating an Immutable object’s class Creating an immutable object’s class can be tricky. Minimal requirement to create an immutable object’s class is, make class and every member variable, …
Novice way to implement a Singleton
I believe everyone starts (and even continues to do so) implementing Singleton pattern in following fashion: also read: Java Tutorials Java EE Tutorials Design Patterns Tutorials Java File IO Tutorials Do you find any problem in it? Well, I have!!! The contract of Singleton class can be broken. Let’s discuss Singleton pattern in Simple Threaded …
What is Remote Debugging in Java?
Consider a scenario where you can’t run the application in your development environment, e.g. say your application can run only on a server machine (because it is dependent on some third party interface that are not accessible in your development machine) and you have to resolve a problem (bug). What you can do? Java Remote …