0% found this document useful (0 votes)
3 views3 pages

What Is Java

what is java
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

What Is Java

what is java
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

what is java ?

java is the high -level, object oriented programming language developed by sun
microsystems in 1995
*it is platform -independent, which means we can write code once and run it
anywhere using the JVM(java virtual machine)
*java is mostly used for building desktop applications, web applications, android
apps and enterprise systems.

key features of java:

1.platform independent:

*java is famous for its write once, run anywhere. this means we can write our java
cide ince and it will run on any device or operating system without changing
anything.

2. Object-oriented:

java follows the object oriented programming this makes code clean and reusable.

3. security:

java does not support pointers, it include built -in programs secure for common
problems like memory.

4.Multithreading:

java programs can do many things at the same time using multiple threads. this is
useful for handling complex tasks like processing.

5.just in time(JIT) compiler:

java uses a JIT compiler it improves performance by converting the bytecode into m
achine readable code at the time of execution.

understanding hello world program in java

when we learn any programming language the first step is writing a simple program
to display "hello world" so here is a simple java program that displays "hello
world" on the screen.

class sample
{
public static void main (string[]args)
{
system

how does this work:

*starts a single line comment. the comment does not execute by java.

* public class hello World defines a class named Helloworld . in java , every
program must be inside a class.

*public static void main (string[]args)is the entry point of any java application.
it tells the JVM where to start executing the program.
*write code in a file like HelloWorld.java.

*the java compiler "java" compiler it into bytecode "HelloWolrd.class".

*the JVM(Java Virtual Machine) reads the .class

**there are two types of transmitter


1.compiler
2.interpeter

*compiler will convert complete code into binary language or low level language
process is called compiler.

*interpreter converted the code into line by line process from to binary language
this process is called as interpreter.

what is java process:

in Java process there is 3 types, they are


1.coding
2.compilation
3.execution

* coding will be done by developer


* we should save our java code or file with extension java
* save the file with the same class name
*compilation will be done by javac
*java c will be convert java code to byte code
*byte code cant be understandable by developer or cpu
* byte code is autogenerated code with the file extension class Ex: filename.class
*byte code file is called a classfile
*to perform execution are need jdk software .
*jdk contains javac, JVM,JRE packages in build program .
*JVM will take byte code as an input and execute line by line and convert into low
level language then given to cpu.

*editors:

editors is used to write the code ,they are two types of editors
1.Advance editors
2.basic editors

Advance editors: basic editors


visual code notepad
eclipse turbo
inteliji entiplus
netebeans

Intro:

Java invented in the year 1995 by the green, james gosling was team lead we are
using java8 present version of java is 1.8.

structures of java program


class ClassName
{
Public static void main(string[]args)
{
java structure
}
}

readability:
readability means up code written by me it has to be understandable by other
developer to improve readability we go with pascal casing and camel casing.

pascal casing:

pascal casing says that every world first character must be in capital letter
*class be in capital letter
*while writing class name don't give space.
* java file name must be same as class name

camelcasing:

camelcasing says first world must be in lower case second world first character
must be in upper case.
*Methods, variables, object name, will follow camelcasing.

pascalcasing tack_book (correct)


program (incorrect) 1program (incorrect)
Firstprogram1 (correct) MyMethod (incorrect)
First_program (correct) workhand (incorrect)
first program (incorrect) one_Method (correct)
1program (incorrect) Sample@ (incorrect)

You might also like