Особенности Java. Блок static static { } Создание и уничтожение объектов  new – создание объекта  finalyze()

Slides:



Advertisements
Similar presentations
9 Copyright © 2005, Oracle. All rights reserved. Using Strings, String Buffer, Wrapper, and Text-Formatting Classes.
Advertisements

Java
EXtreme Programming XP Тема 3. XP Пусть есть некоторая информационная система для банков. В качестве основной валюты для расчетов используется доллар,
String Pemrograman Berbasis Obyek Oleh Tita Karlita.
INTERFACES IN JAVA 1.Java Does not support Multiple Inheritance directly. Multiple inheritance can be achieved in java by the use of interfaces. 2.We need.
Computer Science 209 Software Development Equality and Comparisons.
Strings in Java 1. strings in java are handled by two classes String &
Chapter 7 Strings F To process strings using the String class, the StringBuffer class, and the StringTokenizer class. F To use the String class to process.
1 Working with String Duo Wei CS110A_ Empty Strings An empty string has no characters; its length is 0. Not to be confused with an uninitialized.
Chapter 7 Strings F Processing strings using the String class, the StringBuffer class, and the StringTokenizer class. F Use the String class to process.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 8 Strings.
Chapter 5 Functional Methods. © Daly and Wrigley Learning Java through Alice Objectives Properly construct and use methods when programming. Describe.
Java Programming Strings Chapter 7.
Strings An extension of types A class that encompasses a character array and provides many useful behaviors Chapter 9 Strings are IMMUTABLE.
Java Strings in 10 minutes
©2004 Brooks/Cole Chapter 7 Strings and Characters.
ООП Классы. Данные отдельно, методы отдельно struct Node { Node* next; void* data; }; struct List { Node* first; int size; }; void* allocate() { … } void.
String class  Construct a string  String str = new String(“welcome”);  Char[] charr = {‘G’, ‘o’, ‘o’, ‘d’};  String mes = new String(charr);  A full.
ООП Классы – 2. Ссылки Ссылка – еще одно имя объекта. Используйте ссылки вместо указателя. Это более безопасно. Complex c(10,10); Complex c2& = c; c2+=10;
CIS 234: Strings. What Is a String? series of characters enclosed in double quotes characters can include letters (lower case and upper case), digits,
Язык JavaScript Скриптовый язык для выполнения на html-страницах.
PHP как язык программирования. Типы данных логические величины int, integer – целые числа real, double, float – вещественные числа string – строки array.
1 L41 Collections (1). 2 OBJECTIVES  What collections are.  To use class Arrays for array manipulations.  To use the collections framework (prepackaged.
Контейнеры. Сортировка  Метод sort()  Интерфейс Comparable метод int compareTo(Object o) вызов: Arrays.sort(a)  Интерфейс Comparator метод int compare(Object.
Java: How to Program Arrays and ArrayLists Summary Yingcai Xiao.
Синтаксис языка Java.
Язык Java. JSP..
CSM-Java Programming-I Spring,2005 String Handling Lesson - 6.
Особенности языка JavaScript и его использования.
Наследование и полиморфизм. «Быть» или «Иметь» а так же «Точно» или «Как получится»
Fundamental Programming Structures in Java: Strings.
 Pearson Education, Inc. All rights reserved Strings, Characters and Regular Expressions.
JAVA LIBRARY CLASSES CITS Main concepts to be covered Using library classes: String, Math, Color Reading documentation Java 7 API is available.
Lesson 3 – Regular Expressions Sandeepa Harshanganie Kannangara MBCS | B.Sc. (special) in MIT.
© 2007 Lawrenceville Press Slide 1 Chapter 6 The while Statement  Loop structure that executes a set of statements as long as a condition is true  The.
Advanced Programming Collage of Information Technology University of Palestine, Gaza Prepared by: Mahmoud Rafeek Alfarra Lecture 16: Working with Text.
Session 5 java.lang package Using array java.io package: StringTokenizer, ArrayList, Vector Using Generic.
Java How to Program, 9/e © Copyright by Pearson Education, Inc. All Rights Reserved.
Lecture 14 March 23, Exam Results Class Average was 69.4 –Median was 72.5 (which means there were some very low grades) Questions 31, 32, and 33.
The java.lang Package chapter 8 Java Certification Study Group February 2, 1998 Seth Ladd.
Объектные интерфейсы (.NET) «Школа Инноваций InterSystems 2007»
15440 Distributed Systems Recitation 1 Objected-Oriented Java Programming.
Functions and Arrays. Predefined Functions eval(condition) –Evaluates (executes) JavaScript syntax –Eval returns an undefined value parseInt(string) and.
Saint Petersburg, 2011 Java Lecture Generics. Quiz ArrayList lst = new ArrayList(); Collection c = lst; lst.add("one"); lst.add(“two"); lst.add(“three");
Project 1: Using Arrays and Manipulating Strings Essentials for Design JavaScript Level Two Michael Brooks.
Geoff Holmes Date Math Weighted Distr Strings String methods Tokenizers System Examples Utility Classes (Chapter 17) import java.util.*;
G51PR1 Introduction to Programming I University of Nottingham Unit 8 : Strings.
1 Java Strings Dr. Randy M. Kaplan. 2 Strings – 1 Characters are a fundamental data type in Java It is common to assemble characters into units called.
Java String 1. String String is basically an object that represents sequence of char values. An array of characters works same as java string. For example:
Strings Methods in the String class Manipulating text in Java.
JAC444: Intro to Java Arrays and Vectors Tim McKenna
Sadegh Aliakbary Sharif University of Technology Fall 2010.
Basic Syntax อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา Chapter 2.
ADOBE FLEX Action Script Basics. MXML. Language Basics Action Script 3.0.
JAVA API Strings, I/O, Formatting and Parsing
Strings, Characters and Regular Expressions
Strings, StringBuilder, and Character
String and String Buffers
String Handling in JAVA
Primitive Types Vs. Reference Types, Strings, Enumerations
Modern Programming Tools And Techniques-I Lecture 11: String Handling
Object Oriented Programming
MSIS 655 Advanced Business Applications Programming
Класс Object Макаревич Л. Г..
null, true, and false are also reserved.
Microsoft Visual Basic 2005: Reloaded Second Edition
CS2011 Introduction to Programming I Strings
Strings in Java.
In Java, strings are objects that belong to class java.lang.String .
Presentation transcript:

Особенности Java

Блок static static { }

Создание и уничтожение объектов  new – создание объекта  finalyze()

Массивы  При объявлении массива не указывается количество элементов  Для создания массива надо использовать new с указанием количества элементов  Создание массива не инициализирует его значения  У каждого объекта-массива есть поле length Объявления: String[] a; String a[]; String[] b=new String[5]; String[] c={"a", "b", "c"} String[] d=new String[] {"d", "e", "f"} Класс Arrays equals() fill(el) sort() binarysearch(el) asList()

Строки  Класс String  Невозможно изменить существующую строку, можно только создать новую  Методы concat(S) append(S) substring(Start,End) indexOf(S) lastIndexOf(S) startsWith(S) endsWith(S) charAt(n) replace(S1,S2) toLowerCase() toUpperCase() Integer.parseInt(S)

Спецификаторы доступа  никакого  public  private  protected

Пакеты

Запрещение наследования  final Для полей Для методов Для классов

Абстрактные классы  abstract для метода  abstract для всего класса

Интерфейсы  interface  implements