Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
16 views

Java Introduction-1

Hello
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Java Introduction-1

Hello
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 18

Batch-366

----------------
Java
-------
75%

25%--->Extra skills

Software
==============
1)App's
2)Technical Round
3)Gd(Group Discussion)
4)HR

Technical rounds
------------------------------
1)Mcq's

2)Programming round

3)Wh type Questions

Indiabix.com
-------------------------------------------------------------------------
Java jobs
----------------
1)Java Full stack developer
---------------------------------------------------
1)FrondEnd
2)BackEnd
3)DataBase

2)testing(Automation,manual)
3)framework.

Java jobs in chennai----->?


---------------------------------------------------------
Zero level

30 days
-------------------------------------------------------------------
Notes
Records

Java Introduction
------------------------------------
Java
---------

Programming Language

Program---->set of Instruction.

--->add 2 and 3(2+3)


---->if age is above 18 your eligible

Computer language ---->0's and 1's

Programming Language to share the information to the computer.

types:
---------------
1)low level language
2)middle level language
3)High level Language

I.low level Language


------------------------------------
--->It deal with a computer hardware components.

EX:
----
Assembly Language.

2)middle level Language


------------------------------------------
EX:
-----
C Programming.

3)High level Language


--------------------------------------
EX:
-----
C++
java
python
Php,...

OOPs---->Object Oriented Programming Systems.


--------------
1)class
2)object
3)Inheritance
4)polymorphism
5)DataAbstraction
6)Encapsulation.

which one of the high level programming language?


-----------------------------------------------------------------------------------
-
1)java(correct)
2)C
3)none of the above

what is meant java?


---------------------------------
1)java is a high level language
2)object oriented
3)class-based
4)secured.

Histroy of java
---------------------------
team:green team
project:oak in june 1991(green project)
Author's:James gosling,Patrick naughton,Mike sheridan.

Rename:In 1995 oak(tree name) --->Java(coffee name)

Java is Platform independent.

Java is WORA(Write Onces Run Anywhere)

Java is a Platform --------

a)dependent
b)Independent.

Who is the father of java?


--------------------------------------------
1)James gosling.

Java Structure
---------------------------
class classname
{
//main method
{
//statements
}
}

EX:Besant.java
--------------------------
class Besant
{
public static void main(String[] args)
{
System.out.println("Hello Besant Technologies");
}
}

1)Class name is first capital.


2)classname same as filename.

public--->access specifier
static --->keyword
void --->datatype
main--->main method
String[] args --->Arguments are passed.
---------------------------------------------------
System.out.println

System --->predefined class


out --->field
print --->print the statements
ln,\n --->new line

println()---->method
-------------------------------------------------------------------
Java Editor
---------------------
1)eclipse
2)intelli j
3)Vs Code
4)netbeans

1)Java IDE Deve


2)Java EE devele(Choose)
3)C,c++

JDK---->Java Development

google --->www.eclipse.org

jdk download --->www.oracle.com(windows --->32/64 bit service installer)

--------------------------------------------------------------------------------
JDK,JRE,JVM(*)
----------------------------
JDK ---->Java Development kit
---->It is used for developing Java Application.

JRE
------
Java Run Time Environment.

---->it is used for executing the java program


--->It provides class library and along with JVM

JVM
-------
---Java Virtual machine
--->Java compiler first compile the java code to byte code.
--->jvm convert the byte code into machine code.

it contains two parts


---------------------------------------
1)JDK
2)JRE
How to open an eclipse software?
-----------------------------------------------------------
--->set the workspace

step:1 create the new project


------------------------------------------------
File ---->new ---->project --->Java Project---->project name(EX:BesantProject) ----
>finish

step:2 create the package


----------------------------------------------
Right click the Project name ---->new---->package--->package name(EX:BasicPrograms)
--->finish

step:Create a new class


----------------------------------------
Right click the package name --->new --->class--->class name (Must be first letter
is Capital(EX:Myclass) --->finish.

save --->ctrl+s
run --->ctrl+F11

sysout---->ctrl+spacebar(System.out.println)

ln,\n--->new line(next line)

EX:
----
package BasicPrograms;

public class BesantClass {

public static void main(String[] args)


{
System.out.println("Besant Technologies");
System.out.println("In Chennai");
System.out.println("I am Trainer");

EX:
----
package BasicPrograms;

public class BesantClass {

public static void main(String[] args)


{
System.out.print("Besant Technologies ");
System.out.println("In Chennai");
System.out.println("I am studing java course");
System.out.println("In Besant Technologies");
}

EX:
------
package BasicPrograms;

public class BesantClass {

public static void main(String[] args)


{
System.out.print("Besant Technologies ");
System.out.print("In Chennai\n ");
System.out.print("I am studing java course");

System.out.println("In Besant Technologies");


System.out.println("Have a Nice Day!!!");
}

}
-----------------------------------------------------------------------
Basic Syntax:
------------------------
1)comment lines
-------------------------------
--->Add the notes in your programs.

types:
-----------
1)single line comment-line
2)multiline comment line

1)single line comment-line


-------------------------------------------------
it denoted by //

EX:
-----
int a=100;//a is variable,100 value

2)multi-line comment line


-------------------------------------------
/*
...........
.............
*/

EX:
-----
/*
This
is
multiline comment
line
*/

-----------------------------------------------------------------------
2)semicolon(;)
---------------------------
---->it is used for statement(line) terminator

3)identifiers
-------------------
---->collection of an userdefined names.

EX:
----
Package name,variable name,program(class) name,array name,....

Rules
------------
1)starts with alphabet ,underscore(_)
2)don't starts with digits
3)don't use special character's(other than (_))
4)don't use keywords,.

keywords
--------------------
---->predefined(Reserved) words
---->In java use 50 keywords
---->It written in lowercase letter.
---->Don't use as an identifier.

EX:
-----
public
class
static
if,for,...

In java used how many keywords?


------------------------------------------------------
a)51
b)50
c)49
d)48
-------------------------------------------------------
Variable
------------------
---->It is used to store the value

score:0

game end

score:50

syntax:
-----------------
datatype variablename;

EX:
-----
int a;
float b;

int,float--->datatype
a,b--->variable

types:
--------------
1)local variable
-----------------------------
A variable declared inside the main method.

2)global variable(or)Instance variable


------------------------------------------------------------
A variable declared inside the class but outside the main method.

3)static variable
-----------------------------
A variable declared inside the class but outside the main method using static
keyword.

--->it can't be declared as a local variable.

EX:
------
package BasicPrograms;

public class BesantClass


{

int a=1000;//Instance variable


static int x=10000;//static variable
public static void main(String[] args)
{

int b=100;//local variable.

//static int y=45;---->Error

}
-----------------------------------------------------------------------------------
------------
Datatype
---------------
Data-->value

--->The Datatype is a value ,that tells what kind of data that value can have.
types:
-------------
1)primitive Datatype
2)non-primitive Datatype--->array,class,String,...

1)primitive Datatype
----------------------------------
1)integer
2)floating
3)character
4)boolean

1)integer
----------------
1)byte ---->1 byte

1 byte=8 bits

1GB=1024MB

2)short --->2 bytes


3)int --->4 bytes
4)long ---->8 bytes

EX:
-----
package BasicPrograms;

public class BesantClass


{

public static void main(String[] args)


{

byte a=127;//-128 to 127

short b=32767;//-32768 to 32767

int c=635215332;

long d=987654321589l;

System.out.println("Besant Technologies");
//System.out.println(a+b+c+d);

System.out.println("The Result is "+a);

System.out.println(a);//127

System.out.println(a+" "+b+" "+c+" "+d);

}
}
----------------------------------------------
2)floating
-------------------
1)float--->4 bytes
2)double --->8 bytes

EX:
-----
package BasicPrograms;

public class BesantClass


{

public static void main(String[] args)


{

float x=12.365f;

double y=789223.2365;

System.out.println(x+" "+y);

3)character(2 bytes)
-------------------

1)char---->A letter written by with in single quotes

'a'

2)String --->is a group of character enclosed with in double quotes

"Besant technologies"

Ex:
------
package BasicPrograms;

public class BesantClass


{

public static void main(String[] args)


{

char a='z';
String name="Besant technologies";

System.out.println(a+" "+name);

4)boolean---->1 bit
-------------------------------
1)boolean (true,false)

Ex:
-------
package BasicPrograms;

public class BesantClass


{

public static void main(String[] args)


{

boolean isEligible=true;

System.out.println("Are You Eligible? "+isEligible);

Numbers
------------------
1)whole number (Any number written by without decimal point)

EX:
-----
12,-96,325,456,...

2)floating point number


----------------------------------------------
(Any number written by with decimal point)

EX:
-----
1.3,3.6,56.9,...

---------------------------------------------------------------------
Input Process
----------------------

syntax:
--------------
Scanner objectname=new Scanner(System.in);

EX:
-----
Scanner sc=new Scanner(System.in);

int --->objectname.nextInt();
float --->objectname.nextFloat()
double-->objectname.nextDouble()
char---->objectname.next().charAt(0);
boolean --->objectname.nextBool();

package name---->import java.util.Scanner;

EX:
----
package BasicPrograms;

import java.util.Scanner;

public class BesantClass


{

public static void main(String[] args)


{

int x;

Scanner sc=new Scanner(System.in);

System.out.println("Enter the x value");


x=sc.nextInt();

System.out.println("The Ans is "+x);

Ex:
-----
package BasicPrograms;

import java.util.Scanner;
public class BesantClass
{

public static void main(String[] args)


{

int x,y;

Scanner sc=new Scanner(System.in);

System.out.println("Enter the x and y value");


x=sc.nextInt();
y=sc.nextInt();

System.out.println("Adding Two values are "+(x+y));

EX:
----
package BasicPrograms;

import java.util.Scanner;

public class BesantClass


{

public static void main(String[] args)


{

float x,y;

Scanner sc=new Scanner(System.in);

System.out.println("Enter the x and y value");


x=sc.nextFloat();
y=sc.nextFloat();

System.out.println("Adding Two values are "+(x+y));

}
-----------------------------------------------------------------------------------
--
character
--------------------
package BasicPrograms;

import java.util.Scanner;
public class BesantClass
{

public static void main(String[] args)


{

char letter;

Scanner sc=new Scanner(System.in);

System.out.println("Enter the letter");

letter=sc.next().charAt(0);

System.out.println("Display the letter is "+letter);

Tasks
-----------
1)square and cube of a number
2)find the area of circle,Rectangle and triangle
3)simple interest
4)swapping two values

a=10
b=20

Output
----------------
a=20
b=10

5)sum of five subject marks


-----------------------------------------------------------------------------

You might also like