Download presentation
Presentation is loading. Please wait.
Published byGeorgiana Nash Modified over 8 years ago
1
Java Basics Regular Expressions
2
www.prolearninghub.com A regular expression (RE) is a pattern used to search through text. It either matches the text (or part of it), or fails to match you can easily extract the matching parts, or change them REs are not easy to use at first they're like a different programming language inside Java But, REs bring so much power to string manipulation that they are worth the effort.
3
Regular Expression Example www.prolearninghub.com
4
Regular Expression Pattern & Matcher www.prolearninghub.com
5
Regular Expression Pattern & Matcher www.prolearninghub.com
6
Regular Expression Example www.prolearninghub.com
7
Methods www.prolearninghub.com
8
Methods Naming www.prolearninghub.com
9
Method Declaration www.prolearninghub.com
10
Methods Method Examples www.prolearninghub.com A method that add two numbers. A method sort an array from 1 to 10. A method telling even or odd number. A method printing some message. A method reads from file.
11
Main Method www.prolearninghub.com Every program has a main method. Execution of the program is started from main method. If main method is not defined the program will never execute. There are two types of methods Return a value next = keyboard.nextInt(); keyboard is the calling object. Don’t return a value, called void method System.out.println(“Enter data:”); System.out is the calling object
12
Void Method www.prolearninghub.com Example
13
Method Returning Value www.prolearninghub.com Example
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.