当前位置: 首页 > 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.

http://www.dtcms.com/a/173002.html

相关文章:

  • 【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
  • 数据库的原子事务
  • 阿里云物联网平台--云产品流传
  • Qt6.8中进行PDF文件读取和编辑
  • 【Java学习笔记】包
  • LeetCode 0790.多米诺和托米诺平铺:难想条件的简单动态规划
  • 实验-数字电路设计2-复用器和七段数码管(数字逻辑)
  • 设计模式每日硬核训练 Day 18:备忘录模式(Memento Pattern)完整讲解与实战应用
  • Python基本语法(类和实例)
  • 基于MATLAB的图像色彩识别项目,彩色图像矩阵识别
  • Java:从入门到精通,你的编程之旅