Skip to main content
3 votes
0 answers
102 views

Assume there is a base class in a Java library which cannot be modified public class BaseClass { public Something function(int... args){ ... } } Typically, this would be overridden in Scala by ...
Ian Bertolacci's user avatar
0 votes
3 answers
147 views

How to convert the following scala to java code? for { x <- List(1, 2) y <- List(3, 4) } yield (x, y) Is it possible? what is yield? I guess it's possible to convert any scala code to java.....
J.J. Beam's user avatar
  • 3,193
1 vote
1 answer
99 views

The scala project is depending on the Java lib that I cannot modify. I need to extend one of the Java classes and override method, however I have issues with protected visibility: package com.a; ...
Hedrack's user avatar
  • 786
2 votes
1 answer
73 views

I hava a Java interface: public interface FooJava { void consume(String... strings); void consume(Integer... ints); } and I want to implement it in Scala: class BarScala extends FooJava { ...
Lesiak's user avatar
  • 26.6k
0 votes
1 answer
64 views

I hava a Java interface: public interface FooJava<Element> { void consume(Element[] elements); // more methods } and I want to implement it in Scala: // attempt 1 class BarScala[T] extends ...
Lesiak's user avatar
  • 26.6k
0 votes
1 answer
135 views

trying to use in java class defined in scala library. Definition: final class ScenarioBuilder(...) extends StructureBuilder[ScenarioBuilder] trait StructureBuilder[B <: StructureBuilder[B]] extends ...
Oleksii Pylypchuk's user avatar
0 votes
0 answers
26 views

want to iterate thru bidChoices list and map using scala, below is the java code. what to perform the same using scala. private String generateRestBody(String baseUrl, String auctionId, String ...
Banu's user avatar
  • 47
0 votes
1 answer
177 views

I'm refreshing scala. This looks very simple to me but I can't get it to run: import java.nio.file.{FileSystems, Files} object ScalaHello extends App { val dir = FileSystems.getDefault.getPath(&...
diegoruizbarbero's user avatar
0 votes
0 answers
143 views

Consider the following scala class: class Demo { def mandatoryInt: Int = 42 def optInt: Option[Int] = Some(1) def optString: Option[String] = Some("demo") } When its methods are ...
Roman's user avatar
  • 66.5k
0 votes
1 answer
741 views

I have an object within another object in Scala which I want to import in Java. The setup is something like this: Scala: package scalapart; object Outer { object Inner { def method: ...
David Nemeskey's user avatar
3 votes
2 answers
157 views

Many years of using Scala and still I don't know the right way to interoperate with Java. :( To be honest, this is not something that I'm doing every day, but sometimes there is no other option (today ...
angelcervera's user avatar
  • 4,239
1 vote
1 answer
230 views

I have a Java interface that I want to implement in Scala. The interface contains the following method-declaration: List<Map<String, Object>> xyz(Map<String, Object> var1, Map<...
kiran's user avatar
  • 53
0 votes
2 answers
146 views

I've scala - java polyglot project with scala version 2.13 Below is the standard project structure $scala-java-extend-demo on master ± tree . . ├── build.gradle.kts ├── gradlew ...
user51's user avatar
  • 10.6k
2 votes
0 answers
173 views

this is pretty much the code setup: // java public class JavaA { } // scala class ScalaA() extends JavaA { } but then in java, if i have an instance of ScalaA somewhere (or even if its null), but ...
REghZY's user avatar
  • 68
2 votes
1 answer
306 views

A Scala code has a retry mechanism which is based on currying function: object RetryUtil { def retry[T](retry: Int, timeout: FiniteDuration)(exc: => T): T = { // } } I want to call this code ...
Johnny's user avatar
  • 15.6k

15 30 50 per page
1
2 3 4 5
23