FileInputStream → BufferedInputStream → InputStreamReader → BufferedReader zincirinde hangi desen uygulanmıştır?
Java
Harici bir sisteme erişen bir metoda birim testi nasıl yazılır, böylece gerçek erişim gerçekleşmez?
Git'te başka birinin dalından belirli commitleri nasıl alırsınız?
/** * 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()); }
İki Person nesnesini karşılaştırmak için başka hangi ikinci çözüm önerilebilir?
Java Collection API'de temel arayüzler nelerdir?
Person sınıfı nasıl değiştirilmeli ki değiştirilemez hale gelsin?
equals() ve hashCode() arasında ne sözleşme var?
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); } } } }
Comparable arayüzü nedir ve nasıl kullanılır?
public static void filterTripleA(Collection<String> strings) { strings.removeIf(s -> s.startsWith("aaa")); }
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); } } } }
getTagsOfAuthorsBooks metodunda NullPointerException nerede oluşabilir?
Java'da anotasyon nedir?
class Person { String firstName; String lastName; Integer age; } İki Person nesnesini karşılaştıran standart bir metodun uygulanması gerekmektedir.
Kendiniz ve iş deneyiminiz hakkında (özgeçmişi tekrar etmeden): ilginç görevler, iş bağlamı, kişisel olarak yaptıklarınız
Java'da veritabanlarıyla çalışmak için hangi protokoller, çerçeveler ve kitaplıklar vardır?
GOF (Gang of Four) nedir ve bu kitaptan hangi tasarımlar standart JDK'da uygulanmıştır?