Followers

Total Pageviews

Translate

Tuesday, November 12, 2019

Java

Java

  • Java is a general-purpose programming language that is class-based, object-oriented, and designed to have as few implementation dependencies as possible
  • First appeared: May 23, 1995
  • Designed by: James Gosling
  • Typing discipline: Static, strong, safe, nominative, manifest
  • Developer: Sun Microsystems
  • Filename extensions: java,.class,.jar
  • Java is a widely used programming language expressly designed for use in the distributed environment of the internet. ... Java can be used to create complete applications that may run on a single computer or be distributed among servers and clients in a network.
  • The language was initially called Oak after an oak tree that stood outside Gosling's office

Structure Of Java

Class pro
{
  Public Static void main(String args[])
{
   System.out.print(" ");
}
}


Advantage of Java

  • Java is easy to learn. Java was designed to be easy to use and is therefore easy to write, compile, debug, and learn than other programming languages.
  • Java is object-oriented. This allows you to create modular programs and reusable code.
  • Java is platform-independent.
  • Object-Oriented.
  • Platform-Independent.
  • Distributed computing
  • Secure
  • Memory allocation
  • Multithreaded.

Disadvantage Of  Java

  • Performance. Java programs take much longer time to run compared to C/C++.
  • Memory. ...
  • Cost. ...
  • Low level programming. ...
  • Garbage collection. ...
  • No Unsigned Types Unlike C/C++, Java does not support unsigned int, unsigned char, … etc.

Uses Of Java

  • Mobile applications (specially Android apps)
  • Desktop applications
  • Web applications
  • Web servers and application servers
  • Games
  • Database connection
  • And much, much more!

Example Of Java
MyClass.java

public class MyClass {
public static void main(String[] args) {
int sum1 = 100 + 50;
int sum2 = sum1 + 250;
int sum3 = sum2 + sum2;
System.out.println(sum1);
System.out.println(sum2);
System.out.println(sum3);
}
}


O/P: 150
         400
         800

Key Words Of Java



  • const
  • continue
  • debugger
  • default
  • delete
  • do
  • double
  • else
  • eval
  • false
  • final
  • finally
  • float
  • for
  • function
  • goto
  • if
  • implements
  • in
  • instanceof
  • int
  • interface
  • let
  • long
  • native
  • new null
  • package
  • private
  • protected
  • public
  • return
  • short
  • static
  • switch
  • synchronized
  • this
  • throw
  • throws
  • transient
  • true
  • try
  • typeof
  • var
  • void
  • volatile
  • while
  • with
  • yield

No comments:

Post a Comment