INTRODUCTION TO JAVA PROGRAMMING

JAVA 

The Java programming language is a high-level, object-oriented and general-purpose computer programming language. Java is similar to C++, but simplified to eliminate language features that cause common programming errors.

 Where's Developed 


Java was developed by Sun Microsystems in the early-to-mid 1990s, and development continues to this day, of course. 
A team headed by James Gosling is set up to work on a programming language for consumer electronic devices. 
The goals were to develop a small langauage, that would easily adapt to new chips, and be very reliable. The language was originally known as Oak, but that name was already used, so it had to be changed. 

Features 

Simple 
Secure 
Portable 
Object-oriented 
Robust Multithreaded 
Architecture-neutral 
Interpreted 
High performance 
Distributed 
Dynamic 

Rules 


It Case Sensitivity Java is case sensitive, which means identifier Hello and hello would have different meaning in Java.

Class 


For all class names the first letter should be in Upper Case

Myclassname() 

Method


For all method names the first letter should be in lower Case
 
myMethodname() 

Classes and methods (including other flow-control structures) are always defined in blocks of code enclosed by curly braces { }.

All other statements are terminated with a semi-colon (;).

File name 


Name of the program file should exactly match the class name 
Example : Assume 'DineshClass' is the class name. Then the file should be saved as 'DineshClass.java'. 

Main method


public static void main(String args[])

Java program processing starts from the main() method which is a mandatory part of every Java program.

Hello World Program 

File name : HelloWorld.java

class HelloWorld 


public static void main(String args[]) { 
System.out.println("Hello, World!"); 


Output : Hello, World!


System.out.println() to display text to the terminal. 


Key Words 


Keywords are special tokens in the language which have reserved use in the language. Keywords may not be used as identifiers in Java.You cannot declare a field whose name is a keyword, for instance.

  1. abstract
  2. assert
  3. boolean
  4. break
  5. byte
  6. case
  7. catch
  8. char
  9. class
  10. const
  11. continue
  12. default
  13. do
  14. double
  15. else
  16. enum
  17. extends
  18. final
  19. finally
  20. float
  21. for
  22. goto
  23. if
  24. implements
  25. import
  26. instanceof
  27. int
  28. interface
  29. long
  30. native
  31. new
  32. package
  33. private
  34. protected
  35. public
  36. return
  37. short
  38. static
  39. strictfp
  40. super
  41. switch
  42. synchronized
  43. this
  44. throw
  45. throws
  46. transient
  47. try
  48. void
  49. volatile
  50. while

Comments

Popular posts from this blog

PROGRAMMING LANGUAGES