1-introduction and basics java

Post on 05-Dec-2014

70 Views

Category:

Education

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

 

TRANSCRIPT

Welcome

MAKING THE MOSTOF THIS COURSE

no requiredprogramming experience

no requiredplatform

no requiredbackground

WHAT IS PROGRAMMING?

“A computer program is a

set of instructions…”

turn rightdrive one mileturn left on banktake the second rightfourth house on the

left

turn rightdrive one mile

200 + 300 = 500

STATEMENTS

BASIC LET Balance = 500

AppleScript set balance to 500

Java balance = 500;

COBOL MOVE 500 TO BALANCE

WHAT IS A PROGRAMMING LANGUAGE?

• Is the ability to take the idea into your head, break it a part into each individually pieces and now write those pieces into your programing language using at a time . Writing Your statement in a right order with right syntax

CC++

C#Java

JavaScriptPerlPHP

PythonObjective-C

RubyVisual basic

6A10040C5548EC00144C4800000000001400894800488D8900

01E90001E98D6500000000FA8300893D4D89000A1D6C00E5C2

0889480046E4FF126581G42G6B1B005GF2F2D3E88889000B0A

1B1A2B2A3CD3D45FFFDDAAB111BBCCC8C910202FF06A10040C

5548EC00144C4800000000001400894800488D890001E90001

E98D6500000000FA8300893D4D89000A1D6C00E5C208894800

46E4FF126581G42G6B1B005GF2F2D3E88889000B0A1B1A2B2A

3CD3D45FFFDDAAB111BBCCC8C910202FF0F3D5D08900A2A5B2

B500893D4D89000A1D6C00E5C20889480046E4FF5DD089E4B0

A1F33D3BBB50F0D0A1D1D3D45FFFDDAAB111BBCC0A1D6C00E5

C20889480046E4FF5DD089E4B0A1F33D3BBB50F0D0A1D1D3D4

5FFFDDAAB111BBCC

Machine codeCPU

Assembly Language

CLow-Level Languages

C++

Java, C#, VB.NET

Objective-C

Ruby, Python, PHP

JavaScript, ActionScript

High-Level Languages

WRITING SOURCE CODE

print(“Hello, World!”)Python 3 LuaALGOL 68ALGOL 68 / Python 3 /

ALGOL 60

BEGINDISPLAY (“Hello, Wolrd!”);

END.

C

#include <studio.h>

int main(void){

printf(“Hello, world\n”);return 0;

}

C#

using system;

class Example{

static void Main(string[] args){

Console.WriteLine(“Hello world!”);

}}

Java

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

System.out.println(“Hello, World!”);}

}

Where Java is Used

Where Java is Not Used

• JavaScript• Not Native Mobile Apps for Iphone, Windows

Types Of Java Application

• Games• Mobile Apps• Cloud Computing(is the internet-based

storage for files, applications, and infrastructure)

• Databases• Websites

History Of Java

History Of Java

History Of Java

Runtime Architecture

First Java Program-Example

/*This is a simple java program*/

class Example

{

public static void main (String ar[])

{

System.out.println (“This is a simple Java program”);

}

}

class This marks the starting of java code. It is a key word of java.

public This specify the main ( ) is accessible from outside of the class

static This specify that to execute main ( ) even no class objects have been created

void This specify that method does not return value

main JVM is responsible to execute main method

String ar[] String Array data type, species that main takes some arguments when executed (Note that is no argument specified then Sting array takes null as the argument, hence no error occurs).

System This is name of the class that contains the object

out It is static data member of System class

println This is the method which prints the output in the dos command.

Keywords

• The following keywords are reserved in Java, so you must not use them as class names in your programs

abstract case continue extends goto int package short synchronized try

assert catch default final if interface private static this void

boolean char do finally implements long protected strictfp throw volatile

Break class double float import native public super throws while

Byte const else for instanceof new return switch transient

top related