当前位置: 首页 > news >正文

Scala day6(Class,field,Single Object)

Foreword【こんにちは】

Today, we continue to learn Scala Language, though the Scala isn’t easy for Begainner, Big Data Technology need Scala Language, Spark【Distributed Calculation FrameWork】is based on Scala Language designed. I know the learning road has all kinds of difficults, please you believe in only you insist to study it at last, you could become winner in the game.

Text【本】

object day5 {//The Codes in day5.scaladef main(args:Array[String]): Unit = {System.out.println("Scala is make me happy!!");val example = new examexample.calc(45,25)System.out.println();val example2 = new exam2("abc",123)example2}class exam {var sum = 0;def calc(num:Int,num2:Int): Unit = {sum = num + num2;System.out.println("num = "+num);System.out.println("num2 = "+num2);System.out.println("Sum(num,num2) = "+sum);}}class exam2(digit:String,num:Int) {System.out.println("The first parameter is "+digit);System.out.println("The second parameter is "+num);}
}

The output result:
在这里插入图片描述

The above Codes introduce the Class, field, Single Object. We start to analysize them.
Class have parameters or haven’t parameters both executablely. Field is variable in Class, Single Object is haven’t any parameters.

In the end【さよなら】

I gratitude for みんな watch my articles, my passages maybe have some mistakes, if you could point them, I truely thanks for you. Big Data Technology must learn the Scala Language, please you believe in anything both difficult at first. But you need overcome them and you will become the winner in this game. Your Pan【One low quality man of human】, My name have bread meaning at JaPanese Language【パン】, it sounds interesting, hhh.

相关文章:

  • 【Flask】ORM模型以及数据库迁移的两种方法(flask-migrate、Alembic)
  • 学习路线(嵌入式软件)
  • 【C/C++】无锁编程——compare_exchange_strong
  • LeetCode 热题 100 46. 全排列
  • 为React组件库引入自动化测试:从零到完善的实践之路
  • 【CF】Day51——Codeforces Round 963 (Div. 2) CD
  • 【AI学习】DeepSeek-R1是如何训练的?
  • 我的世界Minecraft游戏服务器搭建教程:腾讯云Java版
  • 学习黑客Nmap 原理
  • 时间同步服务核心知识笔记:原理、配置
  • 【信息系统项目管理师-论文真题】2006下半年论文详解(包括解题思路和写作要点)
  • C# 检查某个点是否存在于圆扇区内(Check whether a point exists in circle sector or not)
  • 五大神经网络开发实战:从入门到企业级部署
  • 【数据结构与算法】同余计算 哈希表与前缀和问题特征和模板化思路
  • 滚珠螺杆的精度如何保持?
  • Nacos源码—3.Nacos集群高可用分析二
  • Vue中的过滤器参数:灵活处理文本格式化
  • Docker 使用下 (二)
  • 知识图谱 + 大语言模型:打造更聪明、更可靠的AI大脑 —— 探索 GraphRAG 中文优化与可视化实践
  • VirtualBox调整虚拟机内存和CPU
  • 金沙记忆|元谋龙街渡:是起点也是终点
  • 繁荣活跃!“五一”假期全国重点零售和餐饮企业销售额同比增长6.3%
  • 人民日报今日谈:为何重视这个“一体化”
  • 美国多地爆发集会抗议特朗普政府多项政策
  • 当农民跨进流动的世界|劳动者的书信①
  • 体坛联播|欧冠巴萨3比3战平国米,柯洁未进入国家集训队