Java Access Modifiers

java-thumbnail

Questions to be answered: What are access modifiers and why do we need them in Java? What are the class-level and method-level access modifiers and its visibility? Access modifiers assists in maintaining the Encapsulation property of Object Oriented Programming concept. For now, just assume that Public means accessible by anyone who has a copy of […]

Java Varargs

java-thumbnail

In this article, we will discuss about passing variable number of arguments to Java methods. Variable arguments feature was introduced in Java 1.5 and it is a very useful feature as we will see in the below examples. Also Read: Java 5 New Features Java 7 Tutorials Java 8 Tutorials Prior to Java 1.5 Lets […]

Java equals() and hashcode()

java-thumbnail

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 […]

Java Math.random() Example

java-thumbnail

In Java, there is a method random() in the Math class, which returns a double value between 0.0 and 1.0. Note that the default random numbers are always generated in between 0 and 1. If you want to get the specific range of values, the you have to multiple the retruned value with the magnitue […]

Java Immutable Objects

java-thumbnail

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

java-thumbnail

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

java-thumbnail

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 […]

The Memory Leak Detector Oracle JRockit

java-thumbnail

Oracle JRockit BookThis book is the result of an amazing series of events. In high school, back in the pre-Internet era, the authors used to hang out at the same bulletin board systems and found each other in a particularly geeky thread about math problems. Bulletin board friendship led to friendship in real life, as well […]

Stochastic Gradient Ascent

java-thumbnail

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 […]

The Most Popular Collaborative Models

java-thumbnail

This article is based on Specification by Example , published on June 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 customers […]