linkedin-skill-assessments-quizzes icon indicating copy to clipboard operation
linkedin-skill-assessments-quizzes copied to clipboard

3 questions for Java quiz

Open Ivanshka opened this issue 2 years ago • 3 comments

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

Ivanshka avatar Oct 15 '22 22:10 Ivanshka

hii can u pls assign me to this issue?

AdityaShaw1 avatar Oct 16 '22 05:10 AdityaShaw1

hlo can u help actually i am bit confused what i have to add to java folder whether this question or answer

AdityaShaw1 avatar Oct 16 '22 17:10 AdityaShaw1

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 and UnansweredQ2.png
  • [ ] Update java-quiz.md with new questions and answers provided here by issue author (Q149, Q150, Q151)

auchynnikau avatar Oct 16 '22 17:10 auchynnikau

Bonjour. Is this issue resolved? If not, assign me to complete it.

briangor avatar Oct 18 '22 17:10 briangor

hello sir @Ebazhanov I added a question #145 in java please merge it under the hacktoberfest label thankyou

VinitGurjar avatar Oct 20 '22 14:10 VinitGurjar