[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 ...
随机推荐
- 7-17 Hashing(25 分)
The task of this problem is simple: insert a sequence of distinct positive integers into a hash tabl ...
- jdbc-DAO的实现
什么是 DAO DAO(Data Access Object)是一个数据访问接口,夹在业务逻辑与数据库资源中间. 在核心J2EE模式中是这样介绍DAO模式的:为了建立一个健壮的J2EE应用,应该将所有 ...
- PHP 中的文本截取分析之效率
PHP 中的文本截取分析之效率 在使用 ThinkPHP 或 Laravel 时都会有用到文本截取的帮助函数. 分别是 msubstr (ThinkPHP 3,ThinkPHP 5 没找到) mb_s ...
- 阿里云 搭建Git服务器
1. 服务端安装git, ssh, 客户端安装git sudo apt-get install git sudo apt-get install ssh 2. 服务单创建用户server sudo a ...
- 几个与JVM相关的JDK工具:jps, jstat, jmap
在项目中遇到OOM(Out of Memory)的问题,为了分析内存和JVM的垃圾回收器GC问题,一并把JVM相关的一些工具也研究了一下: jps:Java进程查看工具,实际上它和Unix/Linux ...
- vim配置之安装脚本
vimConfig/install/install.sh git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle cp ...
- 解决php收邮件乱码问题
function test($strHead){ if(ereg("=\?.{0,}\?[Bb]\?",$strHead)){ $arrHead=split("=\?.{ ...
- 安装MySQL时出现黄色感叹号,提示3306已被占用
windows系统如何查看现在某个端口的应用进程id呢,命令是: 1.netstat -aon|findstr 3306 2.最后的那个数值就是进程id号,此时需要查看该id号对应的应用是哪一个,可 ...
- DB2 数据类型转换
db2数据类型转换: 1.CAST() CAST (<expression> AS <data_ type>[ length ]) 2.CONVERT() CONVERT (& ...
- 10 MySQL--权限管理
权限管理 1.创建账号 # 本地账号 create user '; # mysql -uegon1 -p123 # 远程帐号 create user '; # mysql -uegon2 -p123 ...