• [Training Video


    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 :

  • 相关阅读:
    Ajax 导出Excel 方式
    配置文件类型
    Ionic 发布Release 版本
    $cordovaNetwork 使用
    Web Api 跨域问题
    Python学习(五)--字典
    Python学习(四)--字符串
    Python学习(三)--列表和元组
    mac下安装HTMLTestRunner
    mac下selenium+python环境搭建
  • 原文地址:https://www.cnblogs.com/MasterMonkInTemple/p/5587899.html
Copyright © 2020-2023  润新知