Array in Java

In this post we’ll talk about one of the programming construct array in Java. Topics covered are how to declare an array, how to create and initialize an array, how to store elements in an array and how to access those elements using array indexes, types of arrays in Java.…

Continue reading

Methods in Java

In Java programming language when you create a class it contains variables and methods. In this tutorial we’ll learn about Java methods. In the post Writing First Java Program we have already seen one method; main method which begins the execution of the program. Methods in Java A method is…

Continue reading

Package in Java

A package in Java is used to group a set of related classes and interfaces. In a big Java application containing hundreds or thousands of individual classes, grouping related classes and interfaces into packages helps to keep things organized. Package structure in Java Packages follow the same structure as directories…

Continue reading

Static Block in Java

Static block in Java is used to initialize the static variables (also known as class variables). To initialize instance variables there are constructors, where error handling or other logic can be used. To provide the same capability for class variables, there are static initialization blocks in Java. Syntax of Java…

Continue reading