Java - Tutorialspoint

2y ago
79 Views
11 Downloads
1.04 MB
32 Pages
Last View : 6d ago
Last Download : 3m ago
Upload by : Rosa Marty
Transcription

JavaAbout the TutorialJava is a high-level programming language originally developed by Sun Microsystems andreleased in 1995. Java runs on a variety of platforms, such as Windows, Mac OS, and thevarious versions of UNIX. This tutorial gives a complete understanding of Java.This reference will take you through simple and practical approaches while learning JavaProgramming language.AudienceThis tutorial has been prepared for the beginners to help them understand the basic toadvanced concepts related to Java Programming language.PrerequisitesBefore you start practicing various types of examples given in this reference, we assumethat you are already aware about computer programs and computer programminglanguages.Execute Java OnlineFor most of the examples given in this tutorial, you will find a ‘Try it’ option, which youcan use to execute your Java programs at the spot and enjoy your learning.Try following the example using the ‘Try it’ option available at the top right corner of thefollowing sample code box public class MyFirstJavaProgram {public static void main(String []args) {System.out.println("Hello World");}}i

JavaTable of ContentsAbout the Tutorial . iAudience . iPrerequisites . iExecute Java Online . iTable of Contents . iiJAVA – BASICS . 11.Java – Overview . 2History of Java . 3Tools You Will Need . 3Try It Option . 4What is Next? . 42.Java - Environment Setup . 5Try it Option Online . 5Local Environment Setup . 5Popular Java Editors . 6What is Next? . 63.Java – Basic Syntax . 7First Java Program . 7Basic Syntax . 8Java Identifiers . 9Java Modifiers. 9Java Variables . 9Java Arrays . 9Java Enums . 10Java Keywords . 10Comments in Java . 11Using Blank Lines . 12Inheritance . 12Interfaces . 12What is Next? . 124.Java – Objects & Classes. 13Objects in Java . 13Classes in Java . 14Constructors . 14How to Use Singleton Class? . 15Creating an Object . 17Accessing Instance Variables and Methods. 18Source File Declaration Rules . 20Java Package . 20Import Statements . 21A Simple Case Study . 21What is Next? . 23ii

Java5.Java – Basic Datatypes . 24Primitive Datatypes . 24Reference Datatypes . 26Java Literals . 26What is Next? . 286.Java – Variable Types . 29Local Variables . 29Instance Variables . 31Class/static Variables . 33What is Next? . 347.Java – Modifier Types . 35Java Access Modifiers . 35Java Non-Access Modifiers . 38The Static Modifier . 38The Final Modifier . 39The Abstract Modifier. 41Access Control Modifiers . 43Non-Access Modifiers . 44What is Next? . 448.Java – Basic Operators . 45The Arithmetic Operators . 45The Relational Operators. 47The Bitwise Operators . 49The Logical Operators . 52The Assignment Operators . 53Miscellaneous Operators. 57Precedence of Java Operators . 59What is Next? . 599.Java – Loop Control . 60While Loop in Java . 61for Loop in Java . 62Do While Loop in Java . 65Loop Control Statements . 67Break Statement in Java . 67Continue Statement in Java . 69Enhanced for loop in Java . 70What is Next? . 7110. Java – Decision Making . 72If Statement in Java . 73If-else Statement in Java. 74The if.else if.else Statement . 76Nested if Statement in Java . 77Switch Statement in Java . 78The ? : Operator: . 80What is Next? . 81iii

Java11. Java – Numbers Class . 82Number Methods . 83Java XXXValue Method . 86Java – compareTo() Method . 87Java – equals() Method . 88Java – valueOf() Method . 89Java – toString() Method . 91Java – parseInt() Method . 92Java – abs() Method . 93Java – ceil() Method . 94Java – floor() Method . 95Java – rint() Method . 96Java – round() Method . 97Java – min() Method . 98Java – max() Method . 99Java – exp() Method . 100Java – log() Method . 101Java – pow() Method . 102Java – sqrt() Method. 103Java – sin() Method . 104Java – cos() Method . 105Java – tan() Method . 106Java – asin() Method . 107Java – acos() Method . 108Java – atan() Method . 109Java – atan2() Method . 110Java – toDegrees() Method . 111Java – toRadians() Method . 112Java – random() Method . 113What is Next? . 11412. Java – Character Class . 115Escape Sequences. 115Character Methods . 117Java – isLetter() Method . 117Java – isDigit() Method . 118Java – isWhitespace() Method . 119Java – isUpperCase() Method . 120Java – isLowerCase() Method . 121Java – toUpperCase() Method . 122Java – toLowerCase() Method . 123Java – toString() Method . 124What is Next? . 12513. Java – Strings Class . 126Creating Strings . 126Java – String Buffer & String Builder Classes . 126StringBuffer Methods . 127Java – String Buffer append() Method . 128Java – String Buffer reverse() Method . 129iv

JavaJava – String Buffer delete() Method . 130Java – String Buffer insert() Method . 131Java – String Buffer replace() Method . 132String Length. 135Concatenating Strings . 136Creating Format Strings . 136String Methods . 137Java – String chartAt() Method . 142Java – String compareTo(Object o) Method . 143Java – String compareTo(String anotherString) Method . 144Java – String compareToIgnoreCase() Method . 145Java – String concat() Method . 146Java – String contentEquals() Method . 147Java – String copyValueOf(char[] data) Method . 148Java – String copyValueOf(char[] data, int offset, int count) Method. 149Java – String endsWith() Method . 150Java – String equals() Method . 151Java – String equalsIgnoreCase() Method . 152Java – String getBytes(String charsetName) Method . 154Java – String getBytes() Method . 155Java – String getChars() Method . 156Java – String hashCode() Method . 157Java – String indexOf(int ch) Method . 158Java – String indexOf(int ch, int fromIndex) Method . 159Java – String indexOf(String str) Method . 160Java – String indexOf(String str, int fromIndex) Method . 161Java – String Intern() Method . 162Java – String lastIndexOf(int ch) Method . 163Java – String lastIndexOf(int ch, int fromIndex) Method . 164Java – String lastIndexOf(String str) Method . 165Java – String lastIndexOf(String str, int fromIndex) Method . 166Java – String length() Method . 167Java – String matches() Method . 168Java – String regionMatches() Method . 169Java – String regionMatches() Method . 171Java – String replace() Method . 173Java – String replaceAll() Method. 174Java – String replaceFirst() Method . 175Java – String split() Method . 176Java – String split() Method . 178Java – String startsWith() Method . 180Java – String startsWith() Method . 181Java – String subsequence() Method . 182Java – String substring() Method . 183Java – String substring() Method . 184Java – String toCharArray() Method . 186Java – String toLowerCase() Method . 187Java – String toLowerCase() Method . 188Java – String toString() Method . 189Java – String toUpperCase() Method . 189v

JavaJava – String toUpperCase() Method . 190Java – String trim() Method . 191Java – String

Java i About the Tutorial Java is a high-level programming language originally developed by Sun Microsystems and released in 1995. Java runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UN

Related Documents:

java.io Input and output java.lang Language support java.math Arbitrary-precision numbers java.net Networking java.nio "New" (memory-mapped) I/O java.rmi Remote method invocations java.security Security support java.sql Database support java.text Internationalized formatting of text and numbers java.time Dates, time, duration, time zones, etc.

Java Version Java FAQs 2. Java Version 2.1 Used Java Version This is how you find your Java version: Start the Control Panel Java General About. 2.2 Checking Java Version Check Java version on https://www.java.com/de/download/installed.jsp. 2.3 Switching on Java Console Start Control Panel Java Advanced. The following window appears:

3. _ is a software that interprets Java bytecode. a. Java virtual machine b. Java compiler c. Java debugger d. Java API 4. Which of the following is true? a. Java uses only interpreter b. Java uses only compiler. c. Java uses both interpreter and compiler. d. None of the above. 5. A Java file with

JAVA TUTORIAL Simply Easy Learning by tutorialspoint.com tutorialspoint.com. TUTORIALS POINT Simply Easy Learning ABOUT THE TUTORIAL Java Tutorial Java is a high-level programming language originally developed by Sun Microsystems and released in 1995. Java runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX.

besteht aus der Java-API (Java Application Programming Interface) und der Java-VM (Java Virtual Machine). Abbildung 1: Java-Plattform Die Java-API ist eine große Sammlung von Java-Programmen, die in sog. Pakete (packages) aufgeteilt sind. Pakete sind vergleichbar mit Bibliotheken in anderen Programmiersprachen und umfassen u.a.

JAR Javadoc Java Language jar Security Others Toolkits: FX Java 2D Sound . Java Programming -Week 1. 6/25. Outline Java is. Let’s get started! The JDK The Java Sandbox . into your namespace. java.lang contains the most basic classes in the Java language. It is imported automatically, so

2 Java Applications on Oracle Database 2.1 Database Sessions Imposed on Java Applications 2-1 2.2 Execution Control of Java Applications 2-3 2.3 Java Code, Binaries, and Resources Storage 2-3 2.4 About Java Classes Loaded in the Database 2-4 2.5 Preparing Java Class Methods for Execution 2-5 2.5.1 Compiling Java Classes 2-6

The Java Platform The Java platform has two components: The Java Virtual Machine (Java VM) The Java Application Programming Interface(Java API) The Java API is a large collection of ready-made software components that provide many useful capa