CODE BOARD TECHNOLOGIES – Fresher Interview Questions with answers

CODE BOARD TECHNOLOGIES – Fresher Interview Questions with answers

This blog explains codeboard technology interview questions with answers. Some of the questions are explained clearly below :

_______________________________________________________________________________

1. Write java program to count words without inbuilt functions ? 

INPUT: code board is best code board is best

OUTPUT: code:2 board:2 is:2 best:2 

Length Of The String Without Using Java Built In Length Method :

Java Code With Example

 
The length of the string is easy to define , it is the number of characters in the string including white spaces .
Java make the things easy as it provides the built in length method for the String class (java.lang.String) which is a final class .
for example :
String demo = ” This is a Java built-in method example “
int length= demo.length();
To use the Java built-in method to calculate the length of the string .
Then there is also a way to calculate the length of the string

You can count characters in two ways.

  1. Including space
  2. Excluding space

Below there are 2 programs to count characters in a string, I hope this might help you.

1.Program to count characters in a string including space

  1. import java.util.Scanner;
  2. public class Program
  3. {
  4. public static void main(String[] args)
  5. {
  6. System.out.println(“Enter the String”);
  7. Scanner scan=new Scanner(System.in);
  8. String input = scan.nextLine();
  9. char [] ch = input.toCharArray(); // converts string into character array
  10. System.out.println(ch.length); // prints the character count including space
  11. }
  12. }

2.Program to count characters in a string Excluding space

  1. import java.util.Scanner;
  2. public class Program

  3. {

  4. public static void main(String[] args)

  5. {

  6. System.out.println(“Enter the String”);

  7. Scanner scan=new Scanner(System.in);

  8. String input = scan.nextLine();

  9. char [] ch = input.toCharArray();

  10. int count=0;

  11. for (int i = 0; i < ch.length; i++)

  12. {

  13. if (ch[i]!=‘ ‘)

  14. {

  15. count++;

  16. }

  17. }

  18. System.out.println(count++);

  19. }

  20. }

_______________________________________________________________________________

REFERENCES :

https://www.quora.com/How-do-I-count-characters-in-a-string-in-Java-without-using-charcount

Prepare Effectively with Code Board Technology Interview Questions and Answers

By preparing for the Code Board Technology interview questions and answers helps you get a solid foundation for your upcoming interviews. This blog covers the core programming concepts, logical reasoning, and problem-solving skills. By practicing these questions, you can familiarize yourself with the problems you might encounter in an interview and help to develop the skills to tackle the interview. Try to review regularly by solving the questions that we have mentioned above and the interview questions that we have provided in related blogs, so that you will be able to improve your confidence and technical knowledge for clarity. 

We are a team of passionate trainers and professionals at Payilagam, dedicated to helping learners build strong technical and professional skills. Our mission is to provide quality training, real-time project experience, and career guidance that empowers individuals to achieve success in the IT industry.