Sobes.tech

Java

FileInputStream → BufferedInputStream → InputStreamReader → BufferedReader zincirinde hangi desen uygulanmıştır?

182

Harici bir sisteme erişen bir metoda birim testi nasıl yazılır, böylece gerçek erişim gerçekleşmez?

181

Git'te başka birinin dalından belirli commitleri nasıl alırsınız?

164

/** * Yazarların kitap etiketlerinin listesini, kimlikleri listesiyle belirtilen yazarlar için döndürür * @param authors yazarlar listesi * @param searchAuthorIds alınacak kitap etiketlerinin yazar kimlikleri listesi * @return belirtilen yazarların kitap etiketleri listesi */ public static List<Tag> getTagsOfAuthorsBooks(List<Author> authors, List<String> searchAuthorIds) { return authors.stream() .filter(a -> searchAuthorIds.contains(a.id)) .flatMap(a -> a.books.stream()) .flatMap(b -> b.tags.stream()) .collect(Collectors.toList()); }

164

İki Person nesnesini karşılaştırmak için başka hangi ikinci çözüm önerilebilir?

163

Java Collection API'de temel arayüzler nelerdir?

161

Person sınıfı nasıl değiştirilmeli ki değiştirilemez hale gelsin?

159

equals() ve hashCode() arasında ne sözleşme var?

153

public class RefEx { public interface DocumentProcessor { void process(Document document); } public static class PdfProcessor implements DocumentProcessor { @Override public void process(Document document) { // PDF işleme için özgü mantık } } public static class DocxProcessor implements DocumentProcessor { @Override public void process(Document document) { // Word işleme için özgü mantık } } public static class XmlProcessor implements DocumentProcessor { @Override public void process(Document document) { // XML işleme için özgü mantık } } public static class DocumentService { private final Map<DocumentType, DocumentProcessor> processors = Map.of( DocumentType.PDF, new PdfProcessor(), DocumentType.DOCX, new DocxProcessor(), DocumentType.XML, new XmlProcessor() ); public void process(Document[] documents) { for (Document doc : documents) { // Genel belge işleme mantığı processors.get(doc.type).process(doc); } } } }

152

Comparable arayüzü nedir ve nasıl kullanılır?

145

public static void filterTripleA(Collection<String> strings) { strings.removeIf(s -> s.startsWith("aaa")); }

144

public class RefEx { public static class PdfProcessor implements DocumentProcessor { } public static class DocxProcessor implements DocumentProcessor { @Override public void process(Document document) { // Belirli Word işleme mantığı } } public static class XmlProcessor implements DocumentProcessor { @Override public void process(Document document) { // Belirli XML işleme mantığı } } public static class DocumentService { private final Map<DocumentType, DocumentProcessor> processors = Map.of( DocumentType.PDF, new PdfProcessor(), DocumentType.DOCX, new DocxProcessor(), DocumentType.XML, new XmlProcessor() ); public void process(Document[] documents) { for (Document doc : documents) { DocumentProcessor processor = processors.get(doc.type); if (processor == null) { break; } // Genel belge işleme mantığı processor.process(doc); } } } }

142

getTagsOfAuthorsBooks metodunda NullPointerException nerede oluşabilir?

142

class Person { String firstName; String lastName; Integer age; } İki Person nesnesini karşılaştıran standart bir metodun uygulanması gerekmektedir.

122

Kendiniz ve iş deneyiminiz hakkında (özgeçmişi tekrar etmeden): ilginç görevler, iş bağlamı, kişisel olarak yaptıklarınız

116

Java'da veritabanlarıyla çalışmak için hangi protokoller, çerçeveler ve kitaplıklar vardır?

111

GOF (Gang of Four) nedir ve bu kitaptan hangi tasarımlar standart JDK'da uygulanmıştır?

110