Questions
stringlengths
5
360
Answers
stringlengths
6
2.23k
follow me https www you tubecomcsauravagarwal8 what is a scala map?
Scala Map is a collection of key value pairs wherein the value in a map can be retrieved using the key. Values in a Scala Map are not unique, but the keys are unique. Scala supports two kinds of maps - mutable and immutable. By default, Scala suppo rts immutable map and to make use of the mutable map, programmers must import the scala.collection.mutable.Map class explicitly. When programmers want to use mutable and immutable map together in the same program then the mutable map can be accessed as mutable.map and the immutable map can just be accessed with the name of the map. 9. Name two significant differences between a trait and an abstract class. Abstract classes have constructors with zero or more parameters while traits do not; a class can extend any number of traits but only one abstract class.
what is the use of tuples in scala?
Scala tuples combine a fixed number of items together so that they can be passed around as whole. A tuple is immutable and can hold objects with dif ferent types, unlike an array or list.
what do you understand by a closure in scala?
A closure is also known as an anonymous function whose return value depends upon the value of the variables declared outside the function.
what do you understand by implicit parameter?
Wherever, we require that function could be invoked without passing all the parameters, we use implicit parameter. We provide the default values for all the parameters or parameters which we want to be used as implicit. When the fun ction is invoked without passing the implicit parameters, local value of that parameter is used. We need to use implicit keyword to make a value, function parameter or variable as implicit.
what is the companion object in scala?
null
what are the advantages of scala language?
null
what are the major drawbacks of scala language?
Drawbacks of Scala Language: - Follow Me : https://www.yo utube.com/c/SauravAgarwa l - Less Readable Code - Bit tou gh to Understand the Code for beginners - Complex Syntax to learn - Less Backward Compatibility
what is akka play and sleek in scala?
null
what is unit and in scala?
The 'Unit' is a type like void in Java. You can say it is a Scala equivalent of the void in Java, while still providing the language with an abstraction over the Java platform. The empty tuple '()' is a term representing a Unit value in Scala.
what is the difference between a normal class and a case class in scala?
Following are some key differences between a case class and a normal class in Scala: - case class allows pattern matching on it. - you can create instances of case class without using the new keyword - equals(), hashcode() and toString() method are automatically generated for case classes in Scala - Scala automatically generate accessor methods for all constructor argument
what are high order functions in scala?
Follow Me : https://www.yo utube.com/c/SauravAgarwa l High order functions are functions that can receive or return othe r functions. Common examples in Scala are the filter, map, and flatMap functions, which receive other functions as arguments.
which scala library is used for functional programming?
null
what is the best scala style checker tool available for play and scala based applications?
null
what is the difference between concurrency and parallelism?
When several computations execute sequentially during overlapping time periods it is referred to as concurrency whereas when processes are executed simultaneously it is known as parallelism. Parallel collection, Futures and A sync library are examples of achieving parallelism in Scala.
what is the difference between a java method and a scala function?
null
what is the difference between function and method in scala?
null
what is extractor in scala?
null
is scala a pure oop language?
Yes, Scala is a Pure Object -Oriented Programming Language because in Scala, everything is an Object, and everything is a value. Functions are values and values are Objects. Scala does not have primitive data types and does not have static members.
is java a pure oop language?
Java is not a Pure Object -Oriented Programming (OOP) Language because it supports the following two Non -OOP concepts: Java supports primitive data types. They are not objects.Java supports Static members. They are not related to objects.
does scala support operator overloading scala supports operator overloading
null
does java support operator overloading?
Java does not support Operator Overloading.
follow me https www you tubecomcsauravagarwal30 what are the default imports in scala language?
null
what is an expression?
null
what is a statement difference between expression and statement?
null
what is the difference between java s ifelse and scal as if else?
null
how to compile and run a scala program?
You can use Scala compiler scalac to compile Scala program (like javac) and scala command to run them (like scala)
how to tell scala to look into a class file for some java class?
We can use -classpath argument to include a JAR in Scala's classpath, as shown b elow $ scala -classpath jar Alternatively, you can also use CLASSPATH environment variable.
what is the difference between a call by value and call by name parameter?
The main difference between a call -by-value and a call -by-name parameter is that the former is computed before calling the function, and the latter is evaluated when accessed.
what exactly is wrong with a recursive function that is not tail recursive?
Follow Me : https://www.yo utube.com/c/SauravAgarwa l Answer: You run the risk of running out of stack space and thus throwing an exce ption.
what is the difference between var and value?
null
what is scala anonymous function?
null
what is function currying in scala?
null
what do you understand by unit and in scala?
Unit is a subtype of scala.anyval and is nothing but Scala equivalent of Java void that provides the Scala with an abstraction of the java platform. Empty tuple i.e. () in Scala is a term that repres ents unit value.
whats the difference nil null none and nothing in scala?
null
what is lazy evaluation?
Lazy Evaluation means evaluating program at run -time on -demand that means when clients access the program then only its evaluated. The difference between val and lazy val is that val is used to define variables which are evaluated eagerly and lazy val i s also used to define variables but they are evaluated lazily.
what is call by name?
null
does scala and java support call by name?
Scala supports both call -by-value and call -by-name function parameters. However, Java supports only call-by-value, but not call -by-name.
what is the difference between call by value and call by name function parameters?
null
what do you understand by apply and un apply methods in scala?
null
what is an anonymous function in scala?
null
what are the advantages of anonymous function function literal in scala?
The advantages of Anonymous Functio n/Function Literal in Scala: We can assign a Function Literal to variable We can pass a Function Literal to another function/method We can return a Function Literal as another function/method result/return value.
follow me https www you tubecomcsauravagarwal50 what is the difference between un apply and apply when would you use them?
null
what is the difference between a trait and an abstract class in scala?
null
scala?
According to the private access specifier, private members can be accessed only within that class, but Scalas companion object and class provide special access to private members. A companion object can access all the private members of a companion class. Similarly, a companion class can access all the private members of companion objects.
what are scala variables?
null
mention the difference between an object and a class?
null
what is the difference between val and var in scala?
null
what is the difference between array and list in scala?
null
what is type inference in scala?
null
what is eager evaluation?
Follow Me : https://www.yo utube.com/c/SauravAgarwa l Eager Evaluation means evaluating program at compile -time or program deployment -time irrespective of clients are using that program or not.
what is guard in scal as for comprehension construct?
null
why scala prefers immutability scala prefers immutability in design and in many cases uses it as
null
what are the considerations you need to have when using scala streams?
Streams in Scala are a type of lazy collection, which are created using starting element and then recursively generated using those elements. Streams are like a List, except that, elements are added only when they are accessed, hence lazy. Since streams are lazy in terms of adding elements, they can be unbounded also, and once the elements are added, they are cached. Since Streams can be unbounded, a nd all the values are computed at the time of access, programmers need to be careful on using methods which are not transformers, as it may resul t in java.lang.OutOfMemoryErrors. stream.max stream.size stream.sum 62. Differentiate between Array and List i n Scala. List is an immutable recursive data structure whilst array is a sequential mutable data structure. Lists are covariant whilst array are invariants.The size of a list automatically increases or decreases based on the operations that are performed o n it i.e. a list in Scala is a variable -sized data structure whilst an array is fixed size data structure.
which keyword is used to define a function in scala?
A function is defined in Scala using the def keyword. This may sound familiar to Python de velopers as Python also uses def to define a function.
follow me https www you tubecomcsauravagarwal64 what is monad in scala?
null
is scala statically typed language?
Yes, Scala is a statically -typed language.
what is statically typed language and what is dynamically typed language?
Statically -Typed Language means that Type checking is done at compile - time by compiler, not a t run-time. Dynamically -Typed Language means that Type checking is done at run-time, not at compile -time by compiler.
what is the difference between un apply and apply when would you use them?
null
what is unit in scala?
null
what is the difference between java s void and scala sun it unit is something like java s void
null
what is app in scala?
null
what is the use of scala sapp?
The main advantage of using App is that we dont need to write main method. The main drawback of using App is that we should use same name args to refer command line argument because scala.Apps main() method uses this name.
what are option some and none in scala?
Option is a Scala generic type that can either be some generic value or none. Queue often uses it to represent prim itives that may be null.
what is scala future?
null
how it differs from java s future class?
The main and foremost difference between Scalas Future and Javas Future class is that the later does not provide promises/callbacks operations. The only way to retrieve the result is Future.get () in Java.
what do you understand by diamond problem and how does scala resolve this?
Follow Me : https://www.yo utube.com/c/SauravAgarwa l Multiple inheritance problem is referred to as the Deadly diamond problem or diamond problem. The inability to decide on which implementation of the method to choose is referred to as the Diamond Problem in Scala. Suppose say classes B and C both inherit from class A, while class D inherits from both class B and C. Now while implementing multiple inheritance if B and C override some method from class A, there is a confusion and dilemma always on which implementation D should inherit. This is what is referred to as diamond problem. Scala resolves diamond problem through the concept of Traits and class linearization rules.
what is the difference between in java and scala?
null
what is repl in scala what is the use of scala s repl?
null
what are the similarities between scala sint and java s java lang integer?
null
what are the differences between scala sint and java s java lang integer?
null
what is the relationship between int and rich in tin scala?
null
applications?
null
what is the use of auxiliary constructors in scala?
Auxiliary Constructor is the secondary constructor in Scala declared using the keywords this and def. The main pu rpose of using auxiliary constructors is to overload constructors. Just like in Java, we can provide implementation for different kinds of constructors so that the right one is invoked based on the requirements. Every auxiliary constructor in Scala should differ in the number of parameters or in data types.
how does yield work in scala?
The yield keyword if specified before the expression, the value returned from every expression, will be returned as the collection. The yield keyword is very useful, when there is a need, you want to use the return value of expression. The collection returned can be used the normal collection and iterate over in another loop.
what are the different types of scala identifiers there four types of scala identifiers
Follow Me : https://www.yo utube.com/c/SauravAgarwa l Alpha numeric identifiers Operator identifiers Mixed identifiers Literal identifiers
what are the different types of scala literals?
null
what is sbt what is the best build tool to develop play and scala applications?
null
what is the difference between and in scala?
:: and ::: are methods available in List class. :: method is used to append an element to the beginning of the list. And ::: method is used to concatenate the elements of a given list in front of this list. :: method works as a cons operator for List class. Here cons stands for construct. ::: method works as a concatenation operator for List class.
follow me https www you tubecomcsauravagarwal88 what is the difference between and in scala?
#:: and #::: are methods available in Stream class #:: method words as a cons operator for Stream clas s. Here cons stands for construct. #:: method is used to append a given element at beginning of the stream. #::: method is used to concatenate a given stream at beginning of the stream.
what is the use of in scala based applications?
null
this three question marks is not an operator a method in scala it is used to mark a method
null
what is the best scala style checker tool available for play and scala based applications?
null
how scala supports both highly scalable and highly performance applications?
As Scala supports Multi -Paradigm Programming(Both OOP and FP) and uses Actor Concurrency Model, we can develop very highly Scalable and high -performance applications very easily.
what are the available buildtools to develop play and scala based applications?
Follow Me : https://www.yo utube.com/c/SauravAgarwa l The following three are most popular available Build Tools to develop Play and Scala Applications: SBT Maven Gradle
what is either in scala?
null
what are left and right in scala explain either left right design pattern in scala?
null
how many public class files are possible to define in scala source file?
null
what is nothing in scala?
null
and nothing in scala?
null
how to you create singleton classes in scala?
null
what is option and how is it used in scala?
null
what is the difference between a call by value and call by name parameter?
The main difference between a call -by-value and a call -by-name parameter is that the former is computed before calling the function, and the later is evaluated when accessed.
follow me https www you tubecomcsauravagarwal101 what is default access modifier in scala does scala have public keyword?
null
is scala an expression based language or statement based language?
null
is java an expression based language or statement based language?
null
mention some keywords which are used by java and not required in scala?
Java u ses the following keywords extensively: public keyword - to define classes, interfaces, variables etc. static keyword - to define static members.
why scala does not require them?
null
what is sq oop?
null
why is the default maximum mappers are 4insqoop?
As of my knowledge, the default number of mapper 4 is followed by minimum concurrent task for one machine. We will lead to set a higher number of concurrent tasks, which can result in faster job completion.
is it possible set speculative execution in sq oop?
null