filmov
tv
Java Practice It || 6.13 stripComments || file processing, nested while loop, .subString(), Strings

Показать описание
Problem:
How to use .substring() video:
How to use .indexOf() video:
Question:
Write a method called stripComments that accepts a Scanner representing an input file containing a Java program as its parameter, reads that file, and then prints the file's text with all comments removed. A comment is any text on a line from // to the end of the line, and any text between /* and */ characters. For example, consider the following text:
/* My program
by Suzy Student */
public class Program {
public static void main(String[] args) {
}
public static /* Hello there */ void foo() {
} /* */
}
If the file contained this text, your program should output the following text:
public class Program {
public static void main(String[] args) {
}
public static void foo() {
}
}
How to use .substring() video:
How to use .indexOf() video:
Question:
Write a method called stripComments that accepts a Scanner representing an input file containing a Java program as its parameter, reads that file, and then prints the file's text with all comments removed. A comment is any text on a line from // to the end of the line, and any text between /* and */ characters. For example, consider the following text:
/* My program
by Suzy Student */
public class Program {
public static void main(String[] args) {
}
public static /* Hello there */ void foo() {
} /* */
}
If the file contained this text, your program should output the following text:
public class Program {
public static void main(String[] args) {
}
public static void foo() {
}
}
Java Practice It || 6.13 readme2next || file processing, scanner
Learn Java in 14 Minutes (seriously)
Java Practice It || 3.13 mathExpressions || math.
13y - Learn Java - Exercise 2 - Integer Arithmetic
13 Codingbat | Warmup 1 | frontBack | Java coding practice | Ui Brains | by Naveen Saggam
13x - Learn Java - Exercise 1 - Integer Arithmetic
Loops in Java (Exercise 13)
Урок Java 370: Best practice 6: Переопределение equals
Learn Java - Exercise 13x - Search Strings for a Substring in Java
13z - Learn Java - Exercise 3 - Java Integers and Math
Java Programming All-in-One Tutorial Series (6 HOURS!)
Using Python to Solve Java Problems | Solving Chapter 1 Exercise 13
Java Practice It || 6.20 writeFourLines || writing to a file
Java Exercise 6: Custom Calculator | Java Practice Question
Java Full Course for free ☕
What's New In Java 5, 6, & 7 Webinar 6 13 13 3 02 PM
Java Tutorial for Beginners 2023
Java Practice It || 3.1 printNumbers || method basics
Java MOOC Week 1 Exercises 1-7
Java Program #17 - Sort an Array of Integers in ascending order
Java Spring Boot 14 Years Interview Experience [God Level Skills]
Java Practice-it | Primitive Data and Definite Loops | Self-Check 2.3: expressions1
How to Install Java on Windows 10/11 [ 2023 Update ] JAVA_HOME, JDK Installation
Java Practice It || 2.30 nestedLoops || nested for loop
Комментарии