linkedin-skill-assessments-quizzes
linkedin-skill-assessments-quizzes copied to clipboard
3 questions for Java quiz
In Java folder there are 2 pictures contains "unanswered" questions. One of them is already added and one answered below.
Q149. What code is needed at line 8?
class Main {
public static void main(String[] args) {
Map<String, Integer> map = new HashMap<>();
map.put("a", 1);
map.put("b", 2);
map.put("c", 3);
int result = 0;
result += entry.getValue();
}
System.out.println(result); //outputs 6
}
- [ ] for(MapEntry<String, Integer> entry: map.entrySet()) {
- [ ] for(String entry: map) {
- [ ] for(Integer entry: map.values()) {
- [x] for(Entry<String, Integer> entry: map.entrySet()) {
Q150. What will print when Lambo is instantiated?
class Car {
String color = "blue";
}
class Lambo extends Car {
String color = "white";
public Lambo() {
System.out.println(super.color);
System.out.println(this.color);
System.out.println(color);
}
}
-
[x] blue white white
-
[ ] blue white blue
-
[ ] white white white
-
[ ] white white blue
Q151. Which command will run a FrogSounds app that someone emailed to you as a jar?
- [ ] jar FrogSounds.java
- [ ] javac FrogSounds.exe
- [ ] jar cf FrogSounds.jar
- [x] java -jar FrogSounds.jar
.md file with answers: javaQuiz.md
hii can u pls assign me to this issue?
hlo can u help actually i am bit confused what i have to add to java folder whether this question or answer
hlo can u help actually i am bit confused what i have to add to java folder whether this question or answer
UnansweredQ1.png
contains question that already answered in java-quiz.md
(Q144). So you have to remove this image, because it's no longer relevant.
Also, answer for the question from the UnansweredQ2.png
is provided here, so you have to double check this answer and if it's correct add it in java-quiz.md
and remove image file too.
- [ ] Remove
UnansweredQ1.png
andUnansweredQ2.png
- [ ] Update
java-quiz.md
with new questions and answers provided here by issue author (Q149, Q150, Q151)
Bonjour. Is this issue resolved? If not, assign me to complete it.
hello sir @Ebazhanov I added a question #145 in java please merge it under the hacktoberfest label thankyou