JAVA VS SCALA
POJO IN JAVA VS SCALA
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
| public class PostJ { private String title; private String text; private String author; public String getTitle() { return title; } public void setTitle(String title) { this .title = title; } public String getText() { return text; } public void setText(String text) { this .text = text; } public String getAuthor() { return author; } public void setAuthor(String author) { this .author = author; } }
And the Scala version.
|
Java Syntax:
------------------
<data type> <variable name> = <value> ;
int a = 10;
------------------
val <variable name> : <data type> = <value>
val a : Int = 10
val s : String = "Spark"
var is immutable.
NOTE: SCALA SUPPORTS " TYPE INFER"= automatically find the data type from value.
val a = 10;
val s= "Spark"
var <variable name> : <data type> = <value>
var is mutable.
I enjoy what you guys are usually up too. This sort of clever work and coverage! Keep up the wonderful works guys I’ve added you guys to my blog roll.
ReplyDeleteHadoop Training in Bangalore
It is really nice to see the best blog for Hadoop .This blog helped me a lot easily understandable too.
ReplyDeleteHadoop Training in Velachery | Hadoop Training .
Hadoop Training in Chennai | Hadoop .
It has been simply incredibly generous with you to provide openly what exactly many individuals would’ve marketed for an eBook to end up making some cash for their end, primarily given that you could have tried it in the event you wanted.Digital Marketing Training in Chennai
ReplyDeleteBig data marketingis all about using the tools available to you to acquire, organize and use data in the best possible way. Things can get complicated quickly if you don’t know what you are doing. The following article will help you start to get your big data marketing on the right track.
ReplyDelete