zoukankan      html  css  js  c++  java
  • [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 :

  • 相关阅读:
    [UE4]虚幻引擎的C++环境安装
    [UE4]Drop,扔物品
    [UE4]Grab抓取
    [UE4]抓取准备
    [UE4]用Format Text进行调试
    [UE4]Overlap Event 碰撞事件
    [UE4]Skeletal Mesh的碰撞体
    [UE4]模拟物理
    [UE4]Static Mesh的碰撞体
    [UE4]镜像
  • 原文地址:https://www.cnblogs.com/MasterMonkInTemple/p/5587899.html
Copyright © 2011-2022 走看看