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

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

What is JVM (Java Virtual Machine): Most programming languages such as C/C++ compile source code directly into machine code suitable for execution on a particular microprocessor architecture or operating systems such as Windows or Unix. This property does not make these languages' architecturally neutral'. However, Java is an architectural neutral language as it follows. Write once execute anywhere approach. This feature of Java achieved as the Java compiler does not translate the source code into the machine language of the computer that the program is running on. Instead, the compiler translates source code into bytecode which is not understood by the underlying operating system. So an application is needed that can convert this bytecode into machine code understood by the underlying operating system. It is accomplished using the Java Virtual Machine.



 
by Dinesh Thakur

All the Previous Languages are Structured or we can say that they were procedural programming means in them processing is to be done in sequence manner and These are also called the Top down or either they were bottom up Languages Most Important things those must be in the Languages are Reliability, Maintainability and Reusability and user Friendly So For Achieving these things they Developed java.



 
by Dinesh Thakur

Language: C is a powerful, efficient, general purpose structured programming language. Although C is a high level language but it also supports features of a low level language, so it is sometimes called a middle level language. It is actually binding the gap between a machine language and more conventional high level languages. c++ is partial copy of object oriented programming language that allow programmers to build large and complex applications in a useful and efficient way.

 
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

 
by Dinesh Thakur

Java has a wide variety of data types from which we can choose the suitable for a particular purpose. To operate on variables from two different types of data we have to convert Both types to the same.



 
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

Constants: Constants in java are fixed values those are not changed during the Execution of program. A literal is a constant value that can be classified as integer literals, string literals and boolean literals. To make a static field constant in Java, make a variable as both static and final. java supports several types of Constants  those are  



 
by Dinesh Thakur

An operator is a special symbol that tells the compiler to perform a specific mathematical or logical operation on one or more operands where an operand can be an expression. An operation is an action(s) performed on one or more operands that evaluates mathematical expressions or change the data.

 
by Dinesh Thakur

final: Variables are useful when you need to store information that can change as the program runs. However, there may be certain situations in the program in which the value of the variable should not be allowed to modify. It is accomplished using a particular type of variable known as the final variable. The final variable also called constant variable. It is a variable with a value that cannot modify during the execution of the program.



 
by Dinesh Thakur

In Java, Jump statements are used to unconditionally transfer program control from one point to elsewhere in the program. Jump statements are primarily used to interrupt loop or switch-case instantly. Java supports three jump statements: break, continue, and return.

 
by Dinesh Thakur

Different types of control statements: the decision making statements (if-then, if-then-else and switch), looping statements (while, do-while and for) and branching statements (break, continue and return).

 
by Dinesh Thakur

Multi-dimensional arrays that contain more than one index and can store information in multiple dimensions.  The most common one is a two-dimensional array, also called a matrix or table. In the two-dimensional array, each element associated with two indexes.  We can visualize the two-dimensional array as a spreadsheet, rectangular in shaper and containing elements that divided into columns and rows. However, Java does not indeed support multidimensional arrays. However, one can achieve the same functionality by declaring an array of arrays.



 
by Dinesh Thakur

Just as you can pass primitive type values to methods, you can also pass arrays to a method. To pass an array to a method, specify the name of the array without any square brackets within the method call. Unlike C/C++, in Java every array object knows its own length using its length field, therefore while passing array's object reference into a method, we do not need to pass the array length as an additional argument. For example: Suppose we have an integer array num containing 10 elements.

 
by Dinesh Thakur

Perhaps one of the most important of all concepts that you need to learn in order  to be effective is the array. Until now, we have looked at variables that hold just one  value – the ints hold one number and the strings hold one text string. Arrays are  used when we want to hold two or more values, perhaps a list. Arrays can be  thought as columns in a spreadsheet – a spreadsheet can have one or it can have  many columns.

 
by Dinesh Thakur

Arrays Definition: Perhaps one of the most important of all concepts that you need to learn to be effective is the array. Until now, we have looked at variables that hold just one value – the ints hold one number and the strings hold one text string. Arrays are used when we want to hold two or more values, perhaps a list. Arrays can be thought as columns in a spreadsheet – a spreadsheet can have one, or it can have many columns.  

 
by Dinesh Thakur

Strings often used in programming. Most of the programs use strings such as names, addresses, messages and many more. A string is a sequence of Unicode characters. Unlike most of the programming languages such as C/C++ where strings treated as an array of characters, Java treats a string as an object. Java provides the following classes for storing and processing strings.

 
by Dinesh Thakur

Elements that can be added to the Vector must be of type java .lang. Object. In other words, vectors cannot handle primitive data typeslike int, float, char and double as they are not objects. So in order to work with primitive type variables as if they were objects, Java provides class for each of the primitive types. These classes are known as wrapper classes.



 
by Dinesh Thakur

Generics are used to enforce type-safety in a program. A type-safe program does not have compilation and run-time errors that can result from using incorrect data types.



 

Page 4 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.