Batch 2 feedback link for day 2
Day 1 Notes refer
Java overview
JVM details
Basic syntax
basic data types
Day2 example 2
Testarray.java
class Testarray{
static void min(int arr[]){
int min=arr[0];
for(int i=1;i
if(min>arr[i])
min=arr[i];
System.out.println(min);
}
public static void main(String args[]){
int a[]={33,3,4,5};
min(a);//passing array to method
}}
import java.util.*; import java.io.*; public class ArrayToCollection{ public static void main(String args[]) throws IOException{ BufferedReader in = new BufferedReader (new InputStreamReader(System.in)); System.out.println("How many elements you want to add to the array: "); int n = Integer.parseInt(in.readLine()); String[] name = new String[n]; for(int i = 0; i < n; i++){ name[i] = in.readLine(); } Listlist = Arrays.asList(name); System.out.println(); for(String li: list){ String str = li; System.out.print(str + " "); } } }
Multithread
Inheritance
Program examples 1
package com.ait.mt;
/* @author Vipin_Nittoor
MultiThreadExample .java
*/
public class MultiThreadExample {
public static void main(String[] args) throws InterruptedException {
Printstar p= new Printstar();
p.start();
for (int i = 0; i < 20; i++) {
System.out.println(" +");
Thread.sleep(100);
}
}
}
/**********************/