Anonymous Quiz
63%
True
24%
False
10%
Both
3%
None of the above
Newly Joined Members subscribe to our channel to learn programming and crack written exams.
https://www.youtube.com/c/frbjava
Discuss doubts in @javaforfree
https://www.youtube.com/c/frbjava
Discuss doubts in @javaforfree
find our all latest quizzes at https://www.youtube.com/c/FrbJava/community
Can you write a class if description is given? Along with getters and setters, toString, constructors?
Anonymous Poll
76%
Yes
15%
No
9%
Share a video
public class RemoveSpacesFromString {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
System.out.println(firstApproach(str));
System.out.println(secondApproach(str));
}
private static String secondApproach(String str) {
String strWithoutSpaces ="";
for(int i=0; i<str.length(); i++) {
if(str.charAt(i)!=' ') {
System.out.println("after "+i+"th iteration "+strWithoutSpaces);
strWithoutSpaces +=str.charAt(i);
}
}
return strWithoutSpaces;
}
private static String firstApproach(String str) {
return str.replaceAll(" ", "");
}
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
System.out.println(firstApproach(str));
System.out.println(secondApproach(str));
}
private static String secondApproach(String str) {
String strWithoutSpaces ="";
for(int i=0; i<str.length(); i++) {
if(str.charAt(i)!=' ') {
System.out.println("after "+i+"th iteration "+strWithoutSpaces);
strWithoutSpaces +=str.charAt(i);
}
}
return strWithoutSpaces;
}
private static String firstApproach(String str) {
return str.replaceAll(" ", "");
}
}
👍5
Forwarded from TechShiksha by Badkul Technology
find our all latest quizzes at https://www.youtube.com/c/FrbJava/community
Forwarded from TechShiksha by Badkul Technology
Newly Joined Members subscribe to our channel to learn programming and crack written exams.
https://www.youtube.com/c/frbjava
Discuss doubts in @javaforfree
https://www.youtube.com/c/frbjava
Discuss doubts in @javaforfree
TechShiksha by Badkul Technology
public class RemoveSpacesFromString { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String str = sc.nextLine(); System.out.println(firstApproach(str)); System.out.println(secondApproach(str)); } private…
using same logic can you write a program to remove a character from a string ?
Newly Joined Members subscribe to our channel to learn programming and crack written exams.
https://www.youtube.com/c/frbjava
Discuss doubts in @javaforfree
https://www.youtube.com/c/frbjava
Discuss doubts in @javaforfree
Why do we need while loop, when we already have for loop to do the same thing.
Anonymous Poll
68%
answer in comments
32%
share solution video
Can you write a program to take input from user. In next video we will explain same.
Anonymous Poll
89%
Yes
11%
No
Planning to organize a workshop on weekend to show how to solve basic programs in java written exams?
Anonymous Poll
82%
Interested in free workshop
13%
Interested in paid workshop
5%
Not interested
Newly Joined Members subscribe to our channel to learn programming and crack written exams.
https://www.youtube.com/c/frbjava
Discuss doubts in @javaforfree
https://www.youtube.com/c/frbjava
Discuss doubts in @javaforfree
Forwarded from AI
We are organizing a paid workshop for 99 per person.
The following topics will be covered in the workshop.
1. Java installation
2. Installing eclipse
3. Debugging Skills basic
4. Reverse a String
5. Reverse a Number
6. Factorial of Number
7. Palindrome
8. Fibonacci Series Recursive.
9. Average of Numbers.
10. Find Max and Min in Array
If you face any problems they will be solved immediately by sharing the screen. After that, you will be added to a support group where if you face any issues in a program taught in the workshop will be resolved.
This is much cheaper than any Java coaching and you will get a lot of info in just 2 hours on workshop
Session Date: 19 March 2022
Session Timings: 12-2 PM
Mode of Payment: UPI.
If interested please register your names.
Thanks,
The following topics will be covered in the workshop.
1. Java installation
2. Installing eclipse
3. Debugging Skills basic
4. Reverse a String
5. Reverse a Number
6. Factorial of Number
7. Palindrome
8. Fibonacci Series Recursive.
9. Average of Numbers.
10. Find Max and Min in Array
If you face any problems they will be solved immediately by sharing the screen. After that, you will be added to a support group where if you face any issues in a program taught in the workshop will be resolved.
This is much cheaper than any Java coaching and you will get a lot of info in just 2 hours on workshop
Session Date: 19 March 2022
Session Timings: 12-2 PM
Mode of Payment: UPI.
If interested please register your names.
Thanks,