[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 ...
随机推荐
- 20145237《网络攻防》Web基础
基础问题回答 什么是表单: 表单是一个包含表单元素的区域.表单元素是允许用户在表单中输入信息的元素.表单在网页中主要负责数据采集功能. 浏览器可以解析运行什么语言: 超文本标记语言:HTML: 可扩展 ...
- 未能加载文件或程序集“NPOI”或它的某一个依赖项
自己遇到过得一个很麻瓜很耽误时间的bug,也请教了一些大神嫩是没找到解决方法 下面分享下问题和解决方法 做的是一个下载功能,本地是没问题IIS站点导出EXCEL的时候出错 我这边看不到错误信息,只能一 ...
- .NET/C# 使用反射调用含 ref 或 out 参数的方法
使用反射,我们可以很容易地在运行时调用一些编译时无法确定的属性.方法等.然而,如果方法的参数中包含 ref 或 out 关键字的时候,又该怎么调用呢? 本文将介绍如何反射调用含 ref 或 out 关 ...
- oracle用expdp定时备份所有步骤详解[转]
用oracle命令备份数据库,生成dmp文件,保存了整一套的用户及表数据信息.还原简单.加上widnows的批处理bat命令,实现每天0点备份,现把经验送上给大家! 工具/原料 oracle11g ...
- hive 处理小文件,减少map数
1.hive.merge.mapfiles,True时会合并map输出.2.hive.merge.mapredfiles,True时会合并reduce输出.3.hive.merge.size.per. ...
- Linux环境kafka安装
一. 安装包下载地址 https://www.apache.org/dyn/closer.cgi?path=/kafka/2.0.0/kafka_2.12-2.0.0.tgz 注:下载kafka时有S ...
- 02 - Unit011:Spring AOP
Spring AOP 面向切面(儿)编程(横切编程) Spring 核心功能之一 Spring 利用AspectJ 实现. 底层是利用 反射的动态代理机制实现的 其好处: 在不改变原有功能情况下, 为 ...
- CentOS6.5 安装codeblocks-13.12
安装环境CentOS6.5 启动命令行 1.先安装gcc和gcc++,这个可以直接安装 # yum install gcc # yum install gcc-c++ 2.再安装gtk2,也是直接安装 ...
- 利用spring的ApplicationListener监听某一类事件的发生
1.ApplicationListener在使用过程中可以监听某一事件的发生,可以做出相应的处理,这个方式不常用,但是在特殊情况下面还是有用的. 2.导包pom.xml <project xml ...
- 记一次在 Ubutun16.04 LTS 系统的 python-environment 安装 MySQL-python 的心(苦)路(笑)旅程
背景 之前项目需要准备线啦, 那么好了~~ 数据库也从测试时使用的 SQLITE 升级到了 MYSQL (高大上的免费且开源的关系型数据库,要不要了解一下!) 巧合的是,同事使用的是MySQL-pyt ...