Java programming

Escape sequenceDescription
\nNewline. Position the screen cursor at the beginning of the next line.
\tHorizontal tab. Move the screen cursor to the next tab stop.
\rCarriage return. Position the screen cursor at the beginning of the current
 line—do not advance to the next line. Any characters output after the carriage return overwrite the characters previously output on that line.
\\Backslash. Used to print a backslash character.
\”Double quote. Used to print a double-quote character. For example, System.out.println( “\”in quotes\”” );displays “in quotes”.

Characteristics of java

Java attempts to overcome the limitations of its predecessors and as such it is designed to be:

1.1.1 Simple

Java has much in common with c++ but does not have some features that are present in c++. These features make c++ very powerful but are also very dangerous when in the wrong hands.

1.1.2 Object oriented

In java, data and process are encapsulated together to provide objects that have both state [data] and behavior [process]. This makes it easier for the programmer to model real world things [objects].

1.1.3 Distributed

Java is designed for network programming and can easily work with common internet protocols such as HTTP (hypertext transfer protocol) and FTP (file transfer protocol).it provides facilities to write systems where programs are distributed across many computers.

1.1.4 Robustness

A robust program is one that does not behave unpredictably or fail due to programmer error. Java is more robust compared to other languages because it does not allow programmers to have direct access to the memory. This is so because pointers are not used in java.

1.1.5 Secure

Java has inbuilt security systems that ensure a code once written is not easy to tamper with. There are also a number of restrictions placed on what applets can do when they are running on a remote machine.

1.1.6 Architecture neutrality/Platform independent/portability

Java programs once written can be run on different operating systems. This is made possible by combining compilation and interpretation of the source code.

The java compiler converts the source code into a byte code. This byte code can then be run on any hardware that has a java virtual machine which interprets the byte code to run on a specific hardware.

2 thoughts on “Java programming

Leave a Reply