[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 ...
随机推荐
- bug 报告
准备工作:首先我下载了Git Bash这个软件,利用了老师所给的git命令,批量的pull所有同学第二次作业的代码.截图如下: 一.被测试程序的作者:方铭 程序git地址:https://coding ...
- sql中的一些通用函数
1. SQL中使用case,when,then SELECT CASE TYPE THEN '正常' THEN '密码错误' ELSE '不正常' END '状态' FROM tbl_user 或者 ...
- java面试题6
1.写一个冒泡排序的算法 升序排列: int[] nums = {5,6,9,10,20,30,28,27,15}; for(int i = 0;i<nums.length;i++){ for( ...
- 注册dll文件
1.打开"开始-运行-输入regsvr32 XXX.dll",回车即可 2.win7 64位旗舰版系统运行regsvr32.exe提示版本不兼容 在运行regsvr32.exe的时 ...
- Python threadpool传递参数
threadpool模块是一个很老的实现python线程池的模块,pypi已经建议用multiprocessing代替它了,但是,它使用的便捷性还是征服了一批忠实用户. threadpool模块实现多 ...
- free命令学习 输出理解
命令 [root@localhost ~]# free -m total used free shared buffers cached Mem: 7869 7651 218 1 191 5081 - ...
- Cocos2d-x调用Java 代码
Java代码: package com.dishu; import com.dishu.org.R; import android.app.Activity; import android.app.A ...
- Django models中关于blank与null
建立一个简易Model class Person(models.Model): GENDER_CHOICES=( (1,'Male'), (2,'Female'), ) name=models.Cha ...
- AngularJS开发指南14:依赖注入
推荐两种使用场景: 1.控制器中的依赖注入 控制器是负责应用行为的类.推荐的控制器声明方法如下: var MyController = function(dep1, dep2) { ... } MyC ...
- emacs之配置auto-complete
el-get-install安装auto-complete emacsConfig/auto-complete-setting.el ;这个是设置一个字母就自动完成的 (setq ac-auto-st ...