Download presentation
Presentation is loading. Please wait.
Published byDjaja Kusumo Modified over 5 years ago
1
Basic operation of String Searching Arrays Sorting Arrays
Objectives Basic operation of String Searching Arrays Sorting Arrays The Open Systems Interconnection (OSI) model is a product of the Open Systems Interconnection effort at the International Organization for Standardization (ISO). Fall CS2302: Programming Principles
2
The String Class System.out.println("abc"); Constructing a String:
String message = "Welcome to Java“; String message = new String("Welcome“); String s = new String(); Here are some more examples of how strings can be used: System.out.println("abc"); String cde = "cde"; System.out.println("abc" + cde); Fall CS2302: Programming Principles
3
Read Strings from a file
Scanner inFile = new Scanner(new File("string.txt")); String[] strArray = new String[100]; int numStored = 0; String sentinel = "<<EOD>>"; String line = inFile.nextLine(); while (!line.equals(sentinel)) { strArray[numStored] = line; numStored ++; line = inFile.nextLine(); } System.out.println(numStored + " strings were read in"); Fall CS2302: Programming Principles
4
Basic operation of String Searching Arrays Sorting Arrays
Objectives Basic operation of String Searching Arrays Sorting Arrays The Open Systems Interconnection (OSI) model is a product of the Open Systems Interconnection effort at the International Organization for Standardization (ISO). Fall CS2302: Programming Principles
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.