study of java

PrashantMishra174 39 views 17 slides Feb 21, 2019
Slide 1
Slide 1 of 17
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17

About This Presentation

It describe small concept of java programming language


Slide Content

Topic: Study Of Java

CONTENDS •Histroy of JAVA •Characteristics of java •Java Programming Rule •Working with Scanner Class •Simple java program •Command Line Argument •Primitive Data Type and Wrapper Class •Drawback of java •Application

History of java 1.In 1994, Java was used to develop a Web browser, named Hot Java. 2. Java is automatic memory management. 3.Java was developed by James Gosling in 1995.

Characteristic of java 1.Simple 2. Object-Oriented 3. Distributed 4. Interpreted 5. Robust Secure 6. Portable 7. Multithreaded 8. Dynamic

Java Programming Rule 1.Class name declaration:- First letter of the Class must be in upper case. Example: Class StudentDetail 2. Variable declaration:- it allow camel style. Single character declaration is not allowed. Example: int stuAge; int name;

3.Method declaration:-it follow camel style or single word style. Example: void setOfDetail() void set() 4.Constant declaration:- All the cases will be upper case. Example: int AGE=0; 5.Packages:- All cases must be in lower case. Example: import java.util.Scanner

Working with Scanner Class Scanner:- it is a class .which is used to take Input from the keyboard. There are following method of Scanner class 1.nextByte():for byte type input 2. nextInt(): for int type input 3. nextShort(): for short type input 4. nextFloat(): for float type input 5.nextDouble(): for double type input 6.nextBoolean(): for Boolean type input 7.next():for string type input(without space) 8.nextLine():for string type input(withspace)

Java program Import java.util.Scanner; Class Demo { Static public void main(String…argument) { Scanner scanner=new Scanner(System.in); System.out.println(“Student name:”); String stuName=scanner.next();

System.out.println(“ Student RollNo:”); int rollNo=scanner.nextInt(); System.out.println(“ ---Student Detail---”); System.out.println(“ Name:”+stuName); System.out.println(“ RollNo:” +rollNo); } }

Command Line Argument Command line arguments are handled using main function()function argument where arg refers to the number of arguments passed and arg[] is a pointer array which points to each argument passed to the program.

class Command { static public void main(String...args) { System.out.println("Your first program is:"+args[0]); } } Compile by: javac file.java Run by : java class name welcome

Primitive data type & wrapper class Boxing: The automatic conversion of primitive data type into its equivalent wrapper class. UnBoxing: The automatic conversion of wrapper class into primitive data type

Example of Boxing Class Boxing { Static public void main(String args[]) { int a=50; Integer a2=new Integer(a); Integer a3=5; System.out.println(a2+” ”+a3); } }

Example of Unboxing Class Boxing { Static public void main(String args[]) { Integer a2=new Integer(50); int a3=a2; System.out.println(a3); } }

Drawback of java Java requires high storage capacity and uses more memory. it become slower in performance compared to other languages.

APPLICATION 1.Mobile Application 2.Desktop Application 3.Hacking 4.Web Application 5. Virus creation

Thank you
Tags