Engineering Blog
11 subscribers
69 photos
76 links
Software Engineer @ EPAM Systems
CS @ Millat Umidi University

Talks about:
πŸ“— OS
πŸ“• Networking
πŸ“™ Backend Engineering
πŸ“˜ RDBMS & NoSQL
πŸ“• DS & ALGO
Download Telegram
Forwarded from MJC School | Uzbekistan
Explanation:

Option C is the correct answer.
The static contents are executed when the class is loaded so before the constructors are executed, so the SP will be printed first.  Then the constructor of Person will print CP. Then the Manager class instance code block will print IT before Constructor prints CT.  So, the output is SP CP IT CT. Therefore, option C is correct.
Static content will print only once. So, option D is incorrect.
Other outputs are incorrect as explained above.
The Code compiles fine so, option E is incorrect.

REFERENCE:
http://docs.oracle.com/javase/tutorial/java/IandI/super.html http://docs.oracle.com/javase/tutorial/java/IandI/super.html
Forwarded from MJC School | Uzbekistan
What will be the output of this program:

import java.util.List;

public class MJC {

public static void main(String args[]) {

int factor = 2;
List<Integer> nums = List.of(1, 2, 3, 4, 5);
nums.stream()
.map(num -> num * factor)
.forEach(System.out::print);
factor += 1;
}
}
Forwarded from MJC School | Uzbekistan
Explanation:

Option D is correct.
Lambda expression can only access local variables and parameters of the enclosing block that are final or effectively final. In above code factor does not meet this requirement and compilation fails.

References:
https://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html#syntax
Forwarded from MJC School | Uzbekistan
πŸ“£ Dive into the world of Java at MJC Open Day #3! Don't miss the exciting opportunity to meet our experienced mentors and community leaders in person, ask questions, and gain valuable insights.

πŸ“… Save the Date: October 11
πŸ•™ Time: 11:00 AM

πŸ“Location: Tashkent, 115A, Makhtumkuli St. (IT Park Tashkent, 1st floor)

βœ”οΈ Secure your spot by registering here.

Join us for engaging discussions on Java Technologies by expert speakers and discover the latest trends in the industry. Celebrate the achievements of our graduating students and get inspired by their success stories during the event.

πŸŽ™ Featured Experts:

Asliddin Eshonkulov - Memory Model in Java.
Javokhir Abdullaev - From Trash to Treasure: How JVM Garbage Collectors Keep Your Code Alive.
Leyla Bakhridinova - Introduction to Cloud. AWS Overview
Ruslan Salikhov - What is MCP server?

Be prepared to ask questions and stand a chance to win exciting gifts for the best ones.

We can't wait to welcome all Java enthusiasts and aspiring developers!