by Dinesh Thakur

Java Literals: A literal refers to a fixed value that appears directly in a program. By literal we mean any number, text, or other information that represents a value. This means what you type is what you get. They are commonly known as constants. We will use literals in addition to variables in Java statement.



 
by Dinesh Thakur

Identifiers in Java. A Java identifier is the symbolic name that is used for identification purpose. In Java, an identifier can be a variable name, constant name, method name, class name, array name, packages name or an interface. Few authors term variables as an identifier. For example : int score = 100;

 
by Dinesh Thakur

Immutable class means unmodifiable or unchangeable, i.e., once the object has been created, they are immutable objects, there is no way to modify the text it represents. In Java, all primitive java.lang package wrapper classes (like String, Boolean, Byte, Short, Integer, Long, Float, Double, etc.) and String classes are immutable.



 
by Dinesh Thakur

Java interface used for achieving 100% abstraction because of the interface only contains methods without any implementation or body. However, it contains only abstract methods and constants (final fields). Any field that declared inside interface is public, static, and final by default, any method is an abstract public method. It specifies what must be done but not how. Once an interface is defined, class implements an interface by providing an implementation for each method declared by the interface. Also one class can implement any number of interfaces. Interfaces have the following advantages.

 
by Dinesh Thakur

Defination : The objects, are the building blocks of the object oriented programming language. In some situations, a programer may use multiple objects belonging to different classes which may have some kind of relationship among themselves as they share some common features.

Let us consider an example of a program containing objects of two different classes Car and Motorcycle for maintaining car and motor cycle information respectively. Both Car and Motorcycle classes exhibit some kind of relationship as both are a kind of vehicle and share some common features like speed, engine specification etc. To represent relationship between classes, we use the concept of Inheritance.



 
by Dinesh Thakur

Polymorphism is a very powerful concept that allows you to design amazingly flexible applications. The word 'Polymorphism: is derived form two Greek words 'poly' which means many and 'morphos' which means forms. So, polymorphism means the ability to take many forms.

 
by Dinesh Thakur

Definition: Encapsulation and data hiding are the key features of object oriented programming. Encapsulation refers to the ability to package related behavior in an object bundle and control or restrict their access in both function and data from other objects. It necessarily is all about packaging related stuff together and keeping them away from external elements. You will note that keywords encapsulation along with data hiding is used interchangeably all over.

 
by Dinesh Thakur

Initializing a variable is considered very helpful while making programs. We can initialize variables of primitive types at the time of their declarations. For example:

int a =10;

In Object Oriented Programming language (OOPL) like Java, the need of initialization of fields of a new object is even more common. We have already done this using two approaches.

 
by Dinesh Thakur

A variable in a program occupies some space in computer's memory where some value is stored. A value to be stored may be an integer, floating point number, a character or a string. However, now the question arises that how much memory is allocated to these values and what is the range of values that can be stored in it as different types of values don't occupy same space in memory. So to store these values, we require different data types depending on the needs of the application. The data type determines how much memory is allocated to store data and what operations can be performed on it. The Data type also defines the values that a variable can takes.



 
by Dinesh Thakur

We use the static keyword mostly for memory management, and the keyword goes with the class itself, not with a class instance. It may be:  

• A variable, or class variable
• A method, or class method
• A block
• A nested class
• Static Variable

 

Page 2 of 8

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.