Answer:
<u> FlashCard.java</u>
- public class FlashCard {
- String Question;
- String Answer;
-
- public FlashCard(String q, String a){
- this.Question = q;
- this.Answer = a;
- }
-
- public String toString(){
- String output = "";
- output += "Question: " + this.Question + "\n";
- output += "Answer: " + this.Answer;
- return output;
- }
-
- public boolean equals(String response){
- if(this.Answer.equals(response)){
- return true;
- }
- else{
- return false;
- }
- }
- }
<u>Main.java</u>
- public class Main {
- public static void main(String[] args) {
- FlashCard card1 = new FlashCard("What is highest mountain?", "Everest");
- FlashCard card2 = new FlashCard("What is natural satelite of earth?", "Moon");
- FlashCard card3 = new FlashCard("Who is the first president of US?", "George Washington");
- FlashCard cards [] = {card1, card2, card3};
-
- for(int i=0; i < cards.length; i++){
- System.out.println(cards[i]);
- }
- }
- }
Explanation:
In FlashCard.java, we create a FlashCard class with two instance variable, Question and Answer (Line 2 - 3). There is a constructor that takes two input strings to initialize the Question and Answer instance variables (Line 5-8). There is also a toString method that will return the predefined output string of question answer (Line 10 - 15). And also another equals method that will take an input string and check against with the Answer using string equals method. If matched, return True (Line 17 -24).
In Main.java, create three FlashCard object (Line 3-5) and then put them into an array (Line 6). Use a for loop to print the object (Line 8-10). The sample output is as follows:
Question: What is highest mountain?
Answer: Everest
Question: What is natural satelite of earth?
Answer: Moon
Question: Who is the first president of US?
Answer: George Washington
Answer:
False
Explanation:
Hackers usually perform their attacks in teams, the idea of a lone wolf hacker (single hacker) executing an attack isn't frequent, they work together and have their team names and they are known for their various attacks done for various reasons, reason can be political, business, competition, and so on.
Analog<span> and </span>digital<span> signals are used to transmit information, usually through electric signals. In both these technologies, the information, such as any audio or video, is transformed into electric signals. The </span>difference between analog and digital<span> technologies is that in analog technology, information is translated into electric pulses of varying amplitude. In digital technology, translation of information is into binary format (zero or one) where each bit is representative of two distinct amplitudes. analog vs digital</span>
Using the knowledge in computational language in JAVA it is possible to write a code that the document object to display the current platform in a tag in the webpage
<h3>Writting the code in JAVA:</h3>
<em> <TABLE></em>
<em> <ROWS> </em>
<em> <TR> </em>
<em> <TD>Shady Grove</TD></em>
<em> <TD>Aeolian</TD> </em>
<em> </TR> </em>
<em> <TR></em>
<em> <TD>Over the River, Charlie</TD></em>
<em> <TD>Dorian</TD> </em>
<em> </TR> </em>
<em> </ROWS></em>
<em> </TABLE></em>
<em> </em>
<em />
See more about JAVA at brainly.com/question/12975450
#SPJ1