java.lang

Shallow Copying Vs Deep Copying Copying an Object

Shallow Copying Vs Deep Copying: Copying an object involves getting another object with the same properties of the original. Here, there exists two ways – two objects having their own set of properties (instance variables) or both objects referring the same location of properties. Following gives the detailed discussion. Shallow Copying Shallow copying is the …

Shallow Copying Vs Deep Copying Copying an Object Read More »

Inner classes Java

Introduction to Inner classes Java JDK 1.1 introduced a new type of classes known as inner classes. All the classes you have done so far are known as top-level classes. A class written inside another class is known as "inner class" or "nested class". That is, an inner class is enclosed within another class. Inner …

Inner classes Java Read More »

Garbage Collection gc() exit(0)

Garbage Collection gc() exit(0) Summary: In this "Garbage Collection gc() exit(0)", the basics of garbage collection focusing the methods gc() and exit(0) illustrated. More on Garbage Collection gc() exit(0) methods Unwanted (not used in the remaining part of the program) objects generated in the process are known as garbage. Java includes a special built-in style …

Garbage Collection gc() exit(0) Read More »

class System

class System Introduction The java.lang.System class comes with many static methods and mainly intended to communicate with the underlying operating systems. Using these methods, it is possible to take keyboard input (using System.in), knowing system time (using currentTimeMillis()), copying an array elements into another (using arraycopy()), to advise to go for garbage collection (using gc()) …

class System Read More »

class Math Java

Introduction The java.lang.Math class includes many methods with which many simple arithmetic operations can be done like finding the square root, rounding, trigonometric and logarithm functions. As these methods are defined as static, they can be used directly by the programmer without the trouble of creating an object. Following is the class signature as defined …

class Math Java Read More »

JAR Java ARchive Files

JAR Java ARchive Files Introduction JAR is an acronym for Java ARchive. It is the zipping technique of Java. Always, the zipping styles are platform-dependent. A WinZip file can be zipped and unzipped on Windows platform only. The Java files, which are platform-independent, zipped with WinZip makes them platform-dependent (opens on Windows platform only). To …

JAR Java ARchive Files Read More »