Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

input char arrayjava

char[] testAnswers = {'B','D','A','A','C','A','B','A','C','D'};
int uA =testAnswers.length;//to find the length of testAnswers array i.e. 10
char[] userAnswers = new char [uA]; 
char userInput;
int i;
Scanner in = new Scanner(System.in);
for (i =0; i<uA;i++) 
 {           
        System.out.print("Question #"+(i+1)+": ");
        userInput = Character.toUpperCase(in.next().charAt(0));
 }

  for(i=0;i<ua;i++) 
  {
       System.out.println(userAnswers[i]);
  }
  System.out.println("Data has been recorded");
Comment

PREVIOUS NEXT
Code Example
Java :: Value Change Listener to JTextField 
Java :: Create EntityManager Hibernate 
Java :: install oracle java ubuntu 20.04 
Java :: share location in android programmatically 
Java :: spring logback configuration 
Java :: java string split underscore 
Java :: java programme for fibonnaci series 
Java :: copy text from header tag in javacript 
Java :: log messages not printing in springboot using org.slf4j.Logger; 
Java :: string compareto vs equals java 
Java :: java stream add to existing list 
Java :: djava days between two dates 
Java :: processing pi 
Java :: java user home directory macos 
Java :: Java Creating an EnumMap 
Java :: Java long Keyword 
Java :: multithreading in java 
Java :: json java 
Java :: string into ascii in java 
Java :: set decimal point in java 
Java :: position of an element in infinite sorted array 
Java :: declare matrix in java 
Java :: array in java 
Java :: convert character arraylist to array 
Java :: logcat android 
Java :: properties object java 
Java :: kafkalistener annotation pass topic from properties file 
Java :: array 2 
Java :: prefix vs postfix increment java 
Java :: how to find poiwer in java 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =