Category: java topic
-
Constructor
Java constructors or constructors in Java is a terminology been used to construct something in our programs. A constructor in Java is a special method that is used to initialize objects. The constructor is called when an object of a class is created. It can be used to set initial values for object attributes. In…
-
Method overloading
The Java programming language supports overloading methods, and Java can distinguish between methods with different method signatures. This means that methods within a class can have the same name if they have different parameter lists Suppose that you have a class that can use calligraphy to draw various types of data (strings, integers, and so…
-
Return key and type casting in java
Returning a Value from a Method A method returns to the code that invoked it when it whichever occurs first. You declare a method’s return type in its method declaration. Within the body of the method, you use the return statement to return the value. Any method declared void doesn’t return a value. It does…
-
Global and local variables in java
Today my java class is how to declare and initialize global and local variables in java program so i write this blog by my understanding and learning from online My trainer mr.Muthuramalingam says global variables are declared outside of the method or block and inside of the class. it should be declared as static and…
-
History of java
Java is a powerful, versatile, and simple general-purpose programming language. It is one of the most widely used high-level programming languages in the world. Java is a full-featured general-purpose programming language that is used for developing platform-independent software (applications) running on desktop computers, mobile devices, and servers. It is a simple, object-oriented, distributed, interpreted, secure,…
-
Variable declaration in java
Variable in Java is a data container that saves the data values during Java program execution. Every variable is assigned a data type that designates the type and quantity of value it can hold. A variable is a memory location name for the data. A variable is a name given to a memory location. It…
-
Object creation,method calling,method definition
Create objects in Java There are several ways by which we can create objects of a class in java as we all know a class provides the blueprint for objects, you create an object from a class Methods: Method 1: Using new keyword Using the new keyword in java is the most basic way to…
-
.Java file and .class file
Java is a platform-independent programming language. It involves a two-step execution process instead of the usual one-step compilation like the C language. The first step execution takes place using a compiler, OS independent. The second step execution takes place with the help of a virtual machine, also called JVM or Java Virtual Machine. During the…
-
Encapsulation in java
What is Encapsulation in Java? Encapsulation in Java is a mechanism to wrap up variables(data) and methods(code) together as a single unit. It is the process of hiding information details and protecting data and behavior of the object. It is one of the four important OOPs concepts. Data Hiding in Java Data Hiding in Java…