Scala
xxxxxxxxxx
object abstractTypes extends Application {
abstract class Buffer {
type T; val element: T
}
abstract class SeqBuffer {
type T; val element: Seq[T]; def length = element.length
}
def newIntBuffer(el: Int) = new Buffer {
type T = Int; val element = el
}
def newIntBuffer(el: Int*) = new SeqBuffer {
type T = Int; val element = el
}
println(newIntBuffer(1).element)
println(newIntBuffer(1, 2, 3).length)
}
Linux - كيفية تثبيت anc-api-tools
Linux - كيفية تثبيت curvedns
Linux - كيفية تثبيت zenmap
Python - تحقق مما إذا كان الرقم موجبًا أم سالبًا أم 0
C - عد عدد الأرقام في عدد صحيح
C++ - تحقق مما إذا كان الرقم أوليًا أم لا
C - ابحث عن أكبر رقم باستخدام تخصيص الذاكرة الديناميكي
C++ - تحقق من السنة الكبيسة
Kotlin - عكس رقم
JavaScript - تحقق مما إذا كانت السلسلة تبدأ وتنتهي بأحرف معينة
Linux - كيفية تثبيت zstd
C++ - البحث عن الحاصل والباقي
Python - كتابة ملفات إكسل (XLSX)
Linux - كيفية تثبيت xbitmaps
Java - عكس رقم
Kotlin - أوجد عاملي العدد
Kotlin - تقريب رقم إلى n منازل عشرية
Java - إنشاء الهرم والنمط
We have been online since 2021 and 1 millions of people around the globe have visited our website since then
More visitors every month