Wednesday 25 July 2018

Java

There are some very good questions from this chapter.But almost all of them are direct.
Types of Java :
  • Stand alone : A java program developed by the user.
  • Internet applets : Java programs which are executed using web browser.
Basic features of Java :
  • Object oriented programming
  • both complied and intepreted
  • platform independent
  • No memory pointers like in c++
  • No preprocessor
  • Automatic memory management
  • Built in networking
  • Dynamic binding
  • Open product (i.e) freely available
  • Multithreaded : Perform multiple tasks simultaneously.
 The conversion of high level language(source code) to machine level language can be done in two ways.
Interpreter converts  line by line.
Whereas compiler converts all at once.

Byte code:
The java programs are converted to a code called byte code.It is independent of the machine on which the program is to run.Java virtual machine (JVM)is an interpreter which translates byte code into machine code.
Java Source code--->java complier--->byte code--->JVM

Java code can run on many computers coz  java interpreters(JVM) exist for most operating systems.

Comments in Java :
  • Single line comment : //
  • Multi line comment : /*                        */
Errors :
  • Syntax : e.g semicolon missing,bracket missing,variable not declared.
  • Run time :(e. g)dividing by zero
  • Logic : The program does not produce the answer we want.

No comments:

Post a Comment