[Training Video - 2] [Java Introduction] [Operator, Loops, Arrays, Functions]
Operator :

While Loop :

For Loop :

Arrays :
Code :
public class FirstJavaClass {
public static void main(String[] args) {
int arr[] = new int[5];
arr[0]=78;
arr[1]=980;
arr[2]=98;
arr[3]=9;
arr[4]=765;
System.out.println(arr[2]);
System.out.println("Length of array is --" + arr.length);
for(int i = 0;i<arr.length;i++){
System.out.println(arr[i]);
}
String str[] = new String[3];
str[0]="USA";
str[1]="india";
str[2]="uk";
//str[3]="uytr";
System.out.println("*************TWO DIM ARRAYS****************");
//[ROW][COL]
String s[][] = new String[2][4];
// 1st row
s[0][0]="hello";
s[0][1]="world";
s[0][2]="java";
s[0][3]="qtp";
// 2nd row
s[1][0]="usa";
s[1][1]="uk";
s[1][2]="India";
s[1][3]="Australia";
System.out.println("Rows are --- "+s.length);
System.out.println("cols are -- "+s[0].length);
System.out.println(s[0][1]);
}
}
Result :
98
Length of array is --5
78
980
98
9
765
*************TWO DIM ARRAYS****************
Rows are --- 2
cols are -- 4
world
Object Arrays:

Functions :

[Training Video - 2] [Java Introduction] [Operator, Loops, Arrays, Functions]的更多相关文章
- [Training Video - 2] [Java Introduction] [Install Java and Eclipse, Create Class]
Download Java : https://java.com/en/download/ Download Eclipse : https://www.eclipse.org/downloads/ ...
- [Training Video - 3] [Java Introduction] [Object Oriented Programming]
Static and non-Static : 非静态方法(不带static)可以访问静态变量和方法(带static),但是反过来就不行. 类的静态成员(变量和方法)属于类本身,在类加载的时候就会分 ...
- [Training Video - 2] [Groovy Introduction]
Building test suites, Test cases and Test steps in SOAP UI Levels : test step level test case level ...
- Java – How to join Arrays
Java – How to join Arrays In this article, we will show you a few ways to join a Java Array. Apache ...
- [Training Video - 1] [Introduction to Web services]
What is a web service? http://webservicex.net/ws/default.aspx WebService是一种跨编程语言和跨操作系统平台的远程调用技术. 跨编程 ...
- [Training Video - 6] [File Reading] [Java] Create and Write Excel File Using Apache POI API
package com.file.properties; import java.io.File; import java.io.FileNotFoundException; import java. ...
- [Training Video - 6] [File Reading] [Java] Read Excel File Using Apache POI API
读取以下两种格式的Excel : *.xls and *.xlsx 用Apache POI API来实现,需要用到 HSSF 和 XSSF 的类库 HSSF is the POI Project's ...
- [Training Video - 6] [File Reading] [Java] Read Properties file
package com.file.properties; import java.io.FileInputStream; import java.util.Properties; public cla ...
- 2018 Multi-University Training Contest 4 Problem E. Matrix from Arrays 【打表+二维前缀和】
任意门:http://acm.hdu.edu.cn/showproblem.php?pid=6336 Problem E. Matrix from Arrays Time Limit: 4000/20 ...
随机推荐
- BZOJ2124: 等差子序列(树状数组&hash -> bitset 求是否存在长度为3的等差数列)
2124: 等差子序列 Time Limit: 3 Sec Memory Limit: 259 MBSubmit: 2354 Solved: 826[Submit][Status][Discuss ...
- CF1082D:Maximum Diameter Graph (简单构造)
Graph constructive problems are back! This time the graph you are asked to build should match the fo ...
- IO包中的其他类总结
一.PrintStream和PrintWriter PrintStream 为其他输出流添加了功能,使它们能够方便地打印各种数据值表示形式. PrintStream 打印的所有字符都使用平台的默认字符 ...
- 解决 The word is not correctly spelled问题
The word is not correctly spelled 此问题是eclipse校验单词拼写造成,如果出在配置文件中,一般会影响到程序的正常执行 解决方法:Window--Preferenc ...
- Windows下使用curl命令
curl下载地址: https://curl.haxx.se/download.html 选择对应的版本下载后解压 使用方式(一):在解压后curl.exe所在目录打开cmd,即可使用 使用方式(二) ...
- TypeScript学习笔记(三) - 方法
本篇将介绍在TypeScript里如何定义和使用方法. 一.方法标准声明和使用 // 方法声明 function func(x: number, y: number): number { return ...
- hibernate流程图
流程图: 作者: IT程序狮 链接:http://www.imooc.com/article/1296来源:慕课网
- hadoop之 hadoop日志存放路径
环境:[root@hadp-master hadoop-2.7.4]# hadoop versionHadoop 2.7.4 Hadoop的日志大致可以分为两类: (1).Hadoop系统服务输出的日 ...
- 深入理解java虚拟机,类加载
1,通过使用静态字段,只有真正定义这个字段的类才会被初始化,(子类不初始化,父类初始化 2,new数组,不初始化 3,通过类来调用一些类的常量,可以不初始化类,(常量在编译期,被优化到NotIniti ...
- docker基于commit命令创建支持ssh服务的镜像
以centos为基础,目的使用ssh服务远程连接docker容器. 环境:宿主机centos7(宿主机ip地址为192.168.164.130),直接搜索docker的centos镜像,下载最新版本. ...