Docsity
Docsity

Prepara tus exámenes
Prepara tus exámenes

Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity


Consigue puntos base para descargar
Consigue puntos base para descargar

Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium


Orientación Universidad
Orientación Universidad


Java introduction basic, Apuntes de Tecnología

Introducción a java cosas muy simples

Tipo: Apuntes

2022/2023

Subido el 13/11/2023

mariana-moreno-49
mariana-moreno-49 🇨🇴

1 documento

1 / 6

Toggle sidebar

Esta página no es visible en la vista previa

¡No te pierdas las partes importantes!

bg1
CONFERENCE No 1
Java Intro
First marking period
Page 1 de 6
1
What’s Java?
Java is a programming language and a platform.
Java is a high level, robust, secured and object-oriented programming language.
Platform: Any hardware or software environment in which a program runs, is known as a platform.
Since Java has its own runtime environment (JRE) and API, it is called platform.
Where is it used?
According to Sun, 3 billion devices run java. There are many devices where java is currently used. Some of
them are as follows:
Desktop Applications such as acrobat reader, media player, antivirus etc.
Web Applications
Enterprise Applications such as banking applications.
Mobile
Robotics
Games.
AREA:
TOPIC:
Java Introduction
GRADE:
10
TEACHER:
DATE:
From:
To:
STUDENT NAME:
pf3
pf4
pf5

Vista previa parcial del texto

¡Descarga Java introduction basic y más Apuntes en PDF de Tecnología solo en Docsity!

Java Intro

First marking period Page 1 de 6

What’s Java?

 Java is a programming language and a platform.  Java is a high level, robust, secured and object-oriented programming language.  Platform : Any hardware or software environment in which a program runs, is known as a platform. Since Java has its own runtime environment (JRE) and API, it is called platform.

Where is it used?

According to Sun, 3 billion devices run java. There are many devices where java is currently used. Some of them are as follows:  Desktop Applications such as acrobat reader, media player, antivirus etc.  Web Applications  Enterprise Applications such as banking applications.  Mobile  Robotics  Games. AREA: Computer Science TOPIC: (^) Java Introduction GRADE: 10 TEACHER: Mr. Diego Tovar DATE: From: To: STUDENT NAME:

Java Intro

First marking period Page 2 de 6 Types of Java Applications There are mainly 4 types of applications that can be created using java programming:

  1. Standalone Application It is also known as desktop application or window-based application. An application that we need to install on every machine such as media player, antivirus etc. AWT and Swing are used in java for creating standalone applications.

Java Intro

First marking period Page 4 de 6 Java Example Let's have a quick look at java programming example. import javax.swing.JOptionPane; class Simple{ public static void main(String[] args) { JOptionPane.showMessageDialog(null, "Hello World!!"); } } Understanding first java program Let's see what is the meaning of class, public, static, void, main, String[], System.out.println().  import javax.swing.JOptionPane; a library imported so the JOption statement can work.class keyword is used to declare a class in java.  public keyword is an access modifier which represents visibility, it means it is visible to all.  static is a keyword, if we declare any method as static, it is known as static method. The core advantage of static method is that there is no need to create object to invoke the static method. The main method is executed by the JVM, so it doesn't require to create object to invoke the main method. So it saves memory.  void is the return type of the method, it means it doesn't return any value.  main represents startup of the program.  String[] args is used for command line argument.  JOptionPane.showMessageDialog() is used as a print statement.

Java Variables

A variable is a word or a letter used to hold values or expressions, for example: x=5, y=6, z=x+y. Java variables are used to hold values or expressions. A variable can have a short name, like “x”, or a more descriptive name, like “ carname ”: Rules for Java variable names:  Variable names are case sensitive (y and Y are two different variables)  Variable names must begin with a letter or the underscore character  Variables Can’t contain spaces nor special characters

Java Intro

First marking period Page 5 de 6

Primitive Variables

Declaring (Creating) Java Variables

Creating variables in Java is most often referred to as " declaring " variables. To use any variable in a Java program, you must first declare it. Variable declarations consist of: type variablename;

int myAge;

String myName;

boolean isTired;

byte number;

short hour;

long totalNumberOfStars;

float reactionTime;

double itemPrice;

char letter;

More Java examples:


public static void main(String[] args) { double n, d; n=Double.parseDouble(JOptionPane.showInputDialog("Please enter a number")); d=n*2;