Monday, June 8, 2009

Rules_For_Naming_Variable_In_Java

What are the rules for naming variable in Java?

 

The rules for naming variables in java:-

  1. Must not be a keyword in java.
  2. Must not begin with a digit.
  3. Must not contain embedded spaces.
  4. Can contain characters from various alphabets, like Japanese, Greek and Cyrillic.

Java_Language_Main_Features

Explain the main features of Java language.

 

Java is a simple language that can be learned easily, that’s why the reason of so popularity of java.

            A java programmer needs not to know the internal of java. The syntax of java is similar to c++. Unlike c++, in which the programmer handles memory manipulation, java handles the required memory manipulations, and thus prevents errors that arise due to improper memory usage.

            Java defines data as objects with methods that support the objects, java is purely object-oriented and provides abstraction, encapsulation, inheritance and polymorphism. Even the most basic program has a class. Any code that has to write should be written inside the class.

            Java is tuned of web. Java programs can access data across the web as easily as they access data from a local system. With using java distributed application can be built that uses resources from any other networked computer. Java is both interpreted and compiled. The code is compiled to a byte code that is binary and platform independent. When the program has to be executed, the code is fetched into the memory and interpreted on user’s machine. As an interpreted language, java has simple syntax.

            When a piece of code compiled, all errors are listed together. When all the code is rectified the code can be executed. An interpreter, on the other hand, verifies the code and executes it line by line. Only when the execution reaches the statement with error is the error reported. This makes it easy for a programmer to debug the code. The drawback is that this takes more time than compilation.

            Compilation is the process of converting the code that had typed into a language that the computer understands – machine language. When a program is compiled using a compiler the compiler checks for semantic errors in code and list all errors on the screen. The errors have to be rectified and recompiled to get the machine level code. The java compiler compiles the code to a bytecode that understood by the java environment.

            Bytecode is the result of compiling a java program. This bytecode can be executed at any platform.  In other words, due to the bytecode compilation process and interpretation by a browser, java programs can be executed on a variety of hardware and operating systems. The only requirement is that the system should have java-enabled internet browser.  The java interpreter can be executing java code-enabled browser. The java interpreter can execute java code directly on any machine on which a java interpreter has been installed.

            Thanks to bytecode, a java program can run on any machine that has a java interpreter. The bytecode supports connection to multiple databases. Java code is portable. Therefore, other people can use the programs that are written in java event if they have different machines with different operating systems.

            Java forces the user to handle unexpected errors. This ensures that java program is robust (reliable) and bug free and do not crash.

            Due to strong type checking done by java on the user’s machine, any changes to the program are tagged as error and the program will not run. Java is therefore secure.

            Java is faster than other interpreter-based language like BASIC (Beginners All purpose Symbolic Instruction Code) since it is compiled and interpreted.

            Multithreading is the ability of an application to perform multiple tasks at the same time. The core java is also multithreaded.

            In a nut-shell it can be said that- “java is a simple, object-oriented, distributed, interpreted, robust, secure, architecture neural, portable, high-performance, multithreaded and dynamic language”.

Wednesday, April 29, 2009

Rules For Naming Java

Main Features Of Java

Saturday, April 18, 2009

BCA SMU INTERNAL ASSIGNMENTS

Followers

Template by: