0% found this document useful (0 votes)
2 views

Core Java Notes

The document discusses Java operators, including unary, arithmetic, and shift operators, which are essential for performing operations on variables. It explains Java arrays as objects that store elements of the same data type in contiguous memory, indexed starting from zero, and highlights the difference in array length retrieval between Java and C/C++. Additionally, it covers method overloading in Java, allowing multiple methods with the same name but different parameters to enhance code readability.

Uploaded by

Anant Kanwale
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Core Java Notes

The document discusses Java operators, including unary, arithmetic, and shift operators, which are essential for performing operations on variables. It explains Java arrays as objects that store elements of the same data type in contiguous memory, indexed starting from zero, and highlights the difference in array length retrieval between Java and C/C++. Additionally, it covers method overloading in Java, allowing multiple methods with the same name but different parameters to enhance code readability.

Uploaded by

Anant Kanwale
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Java Arrays

Operator are an essential part of any programming language. In Java, operator is a symbol that is
used to perform operations. For example: +, -, *, / etc. These are essential for performing different
types of operations on variables and values. In this section, we will discuss different types of
operators used in Java programming.

There are many types of operators in Java which are given below:

o Unary Operator,

o Arithmetic Operator,

o Shift Operator,

An array is typically a grouping of elements of the same kind that are stored in a single, contiguous
block of memory.

Java array is an object which contains elements of a similar data type. Additionally, The elements of
an array are stored in a contiguous memory location. It is a data structure where we store similar
elements. We can store only a fixed set of elements in a Java array.

Array in Java is index-based, the first element of the array is stored at the 0th index, 2nd element is
stored on 1st index and so on.

In contrast to C/C++, the length member allows us to obtain the array's length. We must utilise the
sizeof operator in C/C++.

Method Overloading in Java

Method overloading in Java is the feature that enables defining several methods in a class having the
same name but with different parameters lists. These algorithms may vary with regard to the number
or type of parameters. When a method is called, Java decides which version of it to execute
depending on the arguments given. If we have to perform only one operation, having the same name
of the methods increases the readability of the program.

Suppose you have to perform the addition of the given numbers, but there can be any number of
arguments if you write the method such as a(int,int) for two parameters, and b(int,int,int) for three
parameters then it may be difficult for you as well as other programmers to understand the behavior
of the method because its name differs. Here's an explanation with real-life examples:

Math Operations:

You might also like