<repo_name>chary12345/java-1.8<file_sep>/src/main/java/com/multithread/MyImpl.java
package com.multithread;

public class MyImpl {
public static void main(String[] args) {
	
	char[] c=  new char[]{103,111,111,100,0,110,105,103,104,116,160,98,114,111};
	for (char t : c) {
		System.out.print(t);
	}
	
}
}
<file_sep>/src/main/java/com/task/sudocodes/ArrayCompare.java
package com.task.sudocodes;

import java.util.Arrays;

public class ArrayCompare {

	public static void main(String[] args) {
		
		int[] a = {1,2,3};
		int[] b = {1,2,3};
		if(Arrays.equals(a, b)){
			System.out.println("two arrays are same");
		}
		else{
			System.out.println("two arrays are not same");
		}
		ArrayConcat.arraymerge();
	}
}
/**
 * array concatanation in java(binding two arrays)
 * @author ADMIN
 *
 */
class ArrayConcat{
	public static void arraymerge(){
		
		int[] x= {1,2,3,4};
		int[] y={5,6,7,8};
		
		int l1 = x.length;
		int l2 = y.length;
		
		int[] result = new int[l1+l2];
		System.arraycopy(x, 0, result, 0, l1);
		System.arraycopy(y, 0, result, l1, l2);
		System.out.println(Arrays.toString(result));
		
	}
}
<file_sep>/src/main/java/com/practice/sudocodes/SumOfTwoNumbers.java
//To print sum of two digits of x+y;

package practice.sudocodes;

import java.util.Scanner;

public class SumOfTwoNumbers {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		System.out.print("please enter a value of x=");
		
		int x = sc.nextInt();
		System.out.print("please enter a value of y=");
		int y = sc.nextInt();
	int z =	x+y;
		System.out.println("sum of x+y = "+ x+y);
	}
}
<file_sep>/src/main/java/com/com/constructor/CustOwnSinglton.java
package com.constructor;

public class CustOwnSinglton {
private static CustOwnSinglton cs = null;
	private static int id;
	private static String name;
	
	public int getId() {
		return id;
	}

	public String getName() {
		return name;
	}
	
	//write getInstance method for(facory method) create own single tone
	public static CustOwnSinglton getCustOwnSinglton(){
		if(cs==null)
			return cs=new CustOwnSinglton();
		else
		return cs;
		
	}
	
	
}

class CTest{
	public static void main(String[] args) {
		System.out.println(CustOwnSinglton.getCustOwnSinglton().hashCode());
		System.out.println(CustOwnSinglton.class.hashCode());
	}
}<file_sep>/src/main/java/com/java/TestDivision.java
package com.java;

import com.list.DivisionImpl;
import com.list.inter.IDivision;

public class TestDivision {

	public static void main(String[] args) {
		
		IDivision div = new DivisionImpl();
		div.division(22, 11);
	}
}
<file_sep>/src/main/java/com/java/TestAnonymus.java
package com.java;

import com.list.CaluculatorImpl;
import com.list.inter.IParent;

public class TestAnonymus {

	
	public static void main(String[] args) {
		IParent ip = new CaluculatorImpl(){
			
			
		};
		
	}
}
<file_sep>/src/main/java/com/practice/sudocodes/Swapping.java
//swapping 2 numbers

package com.practice.sudocodes;

import java.util.Scanner;

/**
 * 
 * @author ADMIN
 *swapping o inteegers
 *with out using third variable
 */
public class Swapping {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		System.out.println("enter value of x :");
		int x = sc.nextInt();
	
		System.out.println("enter value of y :");
		int y = sc.nextInt();
		System.out.println("--------------------------------------");
		
		x=x+y;
		y=x-y;
		x=x-y;
		System.out.println("--------------------------------------");

		System.out.println("after swapping x= "+x);
		System.out.println("after swapping y = "+y);

	}
}
/*//swapping theory : assume two numbers x&y. add two nubers.do result substract second number,
//keep aside the value(1).these value substracted from addition of two numbers.
//see the out puts=swapped.value is 2,result is 1.*/<file_sep>/src/main/java/com/list/DivisionImpl.java
package com.list;

import com.list.inter.IDivision;

public class DivisionImpl implements IDivision {

	@Override
	public void division(int a, int b) {
		
		System.out.println("The division Value is"+(a/b));
		
		
	}
	

}
<file_sep>/src/main/java/com/list/inter/ISquare.java
package com.list.inter;
@FunctionalInterface
public interface ISquare {

	public int squareNum(int n);
}
<file_sep>/src/main/java/com/task/sudocodes/ReverseNumbers.java
package task.sudocodes;
//reverse number using whike loop

import java.util.Scanner;

public class ReverseNumbers {

	static double number;
	static double reverseNumber;
@SuppressWarnings("resource")
public static void main(String[] args) {
	//checkstt();
	
	System.out.print("enter number to reverse :");
	
	Scanner scanner = new Scanner(System.in);
	number = scanner.nextDouble();
		
	while(number != 0){//25
		reverseNumber = reverseNumber*10.00;//0//50//
		reverseNumber = reverseNumber+number%10.00;//5//50+0.25=52.5
		number = number/10;//2.5//2.5/10=0.25//
		
	}//int ignores decimals
	System.out.println("reverse number is : "+reverseNumber);
}
private static void checkstt() {
	final String s10 = "ravi";
	String s11 = s10.concat("ravi");
	
	System.out.println(s11);
 Integer i=10;
 Integer i1=10;
 System.out.println(i==i1);
 
 Integer i2=127;
 Integer i3=127;
 
 System.out.println(i2==i3);
	String s1 = new String("Java");
	s1.concat("developer");
	 String s6 =s1.concat("java");
	System.out.println("s1 is : "+s1);
	
	String s2 = new String("today");
	final String s3= new String("today");
	String s4 = s2+"exam";
	String s5 = s3+"exam";
	
	
	
	System.out.println(" double equals is "+s4==s5);
	System.out.println("s4.equals s5 is :"+s4.equals(s5));
	System.out.println("double equals "+s2==s3);
	System.out.println(s1.intern());
	System.out.println(s1==s1.intern());
	System.out.println(s1.intern());
	System.out.println(s2.intern()==s3.intern());
	
	System.out.println(  "intern method "+s6.intern());
	
	
	
}
}

		
<file_sep>/src/main/java/com/list/SquareImpl.java
package com.list;

import com.list.inter.ISquare;

public class SquareImpl implements ISquare{

	@Override
	public int squareNum(int n) {

   return n*n;
		
	}

}
<file_sep>/src/main/java/com/serializable/EvenArrayOddArray.java
package com.serializable;

import java.util.Arrays;
import java.util.stream.IntStream;

public class EvenArrayOddArray {
	public static void main(String[] args) {
		int[] a= {12,6,51};int[] b = {22,19,63,84,65};
		int alen = a.length;
		int blen  = b.length;
		int clen  = alen+blen;
		int[] c = new int[clen];
		for (int i = 0; i < a.length; i++) {
			c[i]=a[i];
			
		}
		for (int i = 0; i < b.length; i++) {
			c[alen+i]=b[i];
			
		}
		for (int i = 0; i < c.length; i++) {
			if(c[i]<=c[i]){
				
				System.out.println(c[i]);
			}
		}
		Arrays.sort(c);
		String string = Arrays.toString(c);
		System.out.println(Arrays.toString(c));
	
	//	System.out.println(string);
		
		int[] i = {1,6,4,2,3,551,62,96,45};
		EvenArrayOddArray eo = new EvenArrayOddArray();
		System.out.println("max array is"+eo.maxArray(i));
		int q = (int) EvenArrayOddArray.maxArray(i);
		int p = EvenArrayOddArray.minArray(i);
		int result = q-p;
		System.out.println(result);
	IntStream sorted = Arrays.stream(i).sorted();
	System.out.println(sorted.toArray());
		System.out.print(false);
	}

	private static int minArray(int[] min) {
		int minValue = min[0];
		for (int i = 1; i < min.length; i++) {
			if(min[i]<minValue){
				minValue = min[i];
			}
			
		}
		return minValue;
		
	}
	private static int maxArray(int[] max) {
		int maxValue = max[0];
		for (int i = 1; i < max.length; i++) {
			if(max[i]>maxValue){
				maxValue = max[i];
			}
			
		}
		return maxValue;
		
	}
	

}
<file_sep>/src/main/java/com/task/sudocodes/ArraySum.java
//sum of arrays using with for loop
package task.sudocodes;

public class ArraySum {
	
	public static void main(String[] args) {
		
		int[] a= new int[]{1,2,3,4,5};
		int result = 0;
		for(int i =0; i<a.length;i++){
			result = result+a[i];
		}
		System.out.println("sum of arrays is : "+result);
		
	}

}
<file_sep>/src/main/java/com/supplier/Number50List.java
package com.supplier;

import java.util.LinkedList;
import java.util.function.Function;
import java.util.stream.Collectors;

public class Number50List {

	public static void main(String[] args) {
		
		LinkedList<Integer> list = new LinkedList<>();
		//ArrayList<Integer> list = new ArrayList<>();
	//	HashSet<Integer> list = new HashSet<>();
		// LinkedHashSet<Integer> list = new LinkedHashSet<>();
		//TreeSet<Integer> list = new TreeSet<>();
		
		list.add(22);
		list.add(25);
		list.add(36);
		list.add(41);
		list.add(42);
		list.add(46);
		list.add(49);
		list.add(56);
		list.add(57);
		list.add(58);
		list.add(69);
		list.add(76);
		
		
		
		Function<Integer, Integer> f = t -> {
			if (t < 50)
				return (t + 10);
			else
				
				return t;

		};
		
		
		System.out.println("the final output: ");
		//Consumer<Integer> c = t->System.out.println(t);
		/**
		 * even list of integers,add 10 to <50 integers,&print greternthan 50 numbers with non duplicates.
		 */
	 list.stream().filter(i->i%2==0).map(f).filter(t->t>50).collect(Collectors.toSet()).forEach(t->System.out.println(t));
	
	
	}
}
<file_sep>/src/main/java/com/task/sudocodes/ReverseRightAnleStar.java
package task.sudocodes;

/**
 * 
 * @author ADMIN * * *
 */
public class ReverseRightAnleStar {
	public static void main(String[] args) {

		for(int i=0; i<4; i++){
			for(int j=2*(4-i); j>=0; j--){
				
				System.out.print(" ");
			}
			for(int j=0;j<=i;j++){
				
				System.out.print(" *");
			}
			System.out.println();
		}
	}
}
<file_sep>/src/main/java/com/list/inter/IParent.java
package com.list.inter;

@FunctionalInterface
public interface IParent {

	public void m1(int a, int b);
}
<file_sep>/src/main/java/com/multithread/B.java
package com.multithread;

 class A{
	int x;
	public A(int y){
	x=x+y;
	
	}
public String toString(){
	return "x";
	
}
}
public class B{
	public static void main(String[] args) {
		System.out.println(new A(10));
	}
	
}
<file_sep>/src/main/java/com/predicate/PresicateForEmployeSalary.java
package com.predicate;

import java.awt.List;
import java.util.ArrayList;
import java.util.function.Predicate;

public class PresicateForEmployeSalary {

	
	public static void main(String[] args) {
		
		ArrayList<Employee> emplist = new ArrayList<>();
		emplist.add(new Employee("raju", 100, 102000));
		emplist.add(new Employee("mahendar", 103, 1180000));
		emplist.add(new Employee("vijayender", 104, 1350000));
		emplist.add(new Employee("devendar", 105, 990000));
		emplist.add(new Employee("manikanta", 106, 1140000));
		
		emplist.add(new Employee("dattatreya", 107, 1040000));
		
		/**
		 * get the employee who having more than 104k
		 * in1.8 java
		 */
		Predicate<Employee> p = emp-> emp.getSalary()>10;
		
		for (Employee emp : emplist) {
			
			if(p.test(emp)){
				System.out.println(emp);
			}
			
		}
		/**
		 * performing predicate opperation to print only even number id employee
		 */
		
		Predicate<Employee> p1 = emp->emp.getId()%2==0;
		System.out.println("even number employee list");
		for (Employee empeven : emplist) {
			if(p1.test(empeven))
				System.out.println(empeven);
			
		}
	}
	
}
<file_sep>/src/main/java/com/practice/sudocodes/FibinocciSeries.java
/*//write a program to print fibinocci series
In fibonacci series, next number is the sum of previous two numbers .
for example 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 etc. The first two numbers of fibonacci series are 0 and 1.*/

package com.practice.sudocodes;

public class FibinocciSeries {

	public static void main(String[] args) {
		
	/*	int x=0;
		int y = 1;
		
		System.out.println("fibinoccseries of first 100 numbers are given below");
		
		System.out.print(x+" "+y);
		int z;
		for(int i=2;i<=10;++i){
			z=x+y;
			System.out.print(" "+z);
			x=y;
			y=z;
			
		}*/
		int x = 0;
		int y = 1;
		int z;
		
		for (int i=1;i<10;++i){
			z=x+y;
			System.out.println(" "+z);
			x=y;
			y=z;
		}
	}
	
}
<file_sep>/src/main/java/com/task/sudocodes/MapSream.java
package com.task.sudocodes;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.stream.Collectors;

public class MapSream {
public static void main(String[] args) {
HashMap<Integer, String> m1 = new HashMap<>();
m1.put(1, "vikaram");
m1.put(15, "vikaram");
m1.put(19, "vikaram");
m1.put(29, "vikaram");
m1.put(86, "vikaram");
m1.put(33, "vikaram");
ArrayList<Integer> al = new ArrayList<Integer>(m1.keySet());
HashSet<Integer> hs = new HashSet<>(m1.keySet()); 
hs.stream().sorted().collect(Collectors.toSet()).forEach(t->System.out.println(t));
//al.stream().sorted().collect(Collectors.toSet()).forEach(t->System.out.println(t));
//m1.keySet(). stream().forEach(t->System.out.println(t));


//m1.keySet().stream().map(e->e.compareTo(e)).collect(Collectors.toList()).forEach(t->System.out.println(t));
}
}<file_sep>/src/main/java/com/supplier/NumberPlus50.java
package com.supplier;

import java.util.Arrays;
import java.util.function.IntPredicate;
import java.util.function.IntUnaryOperator;

public class NumberPlus50 {

	public static void main(String[] args) {
	//	std();
		int[] values = new int[] { 22, 36, 42, 46, 49, 51, 67, 68, 71, 76, 84, 89, 92, 96 };
		
	//	IntStream stream1 = Arrays.stream(values);
		
	//	IntPredicate intP = t -> t % 2 == 0;
		
		IntUnaryOperator f = t -> {
			if (t < 50)
				return (t + 10);
			else
				return t;

		};
		
	
	IntPredicate intP1 = t -> t > 50;
		
	
	
		

		/*System.out.println("the final out put as");
		for (int i : values) {
			if (intP.test(i)) {
				int j = f.apply(i);
				if (intP1.test(j))
				System.out.println(j);
			}
		}*/
		Arrays.stream(values).filter(t->t%2==0).map(f).filter(intP1).map(t->t+10).filter(t->t<100).forEach(x -> System.out.println(x));

	}

	
}
<file_sep>/src/main/java/com/java/TestCalLambda.java
package com.java;

import com.list.inter.IParent;

public class TestCalLambda {

	public static void main(String[] args) {
		IParent cal =( a,  b)->{
		
		System.out.println(a+b);
		};
		cal.m1(10, 20);
	}
}
<file_sep>/src/main/java/com/predicate/Predicatest.java
package com.predicate;

public class Predicatest {

	public static void main(String[] args) {
		 
		PredicateImpl p = new PredicateImpl();//predicate always returns the boolean value
		System.out.println(p.test(12365));
		System.out.println(p.test(125));
		System.out.println(p.test(365));
		System.out.println(p.test(12));
		
	}
}
<file_sep>/src/main/java/com/predicate/CharacterCountInString.java
package com.predicate;

public class CharacterCountInString {

	 static final int MAX_CHAR = 200;

	public static void main(String[] args) {
		
		
		String s = "<NAME>";
		
		int count[] = new int[MAX_CHAR]; 
		int l = s.length(); 
		
		
		//intialize count array Index
		for (int i = 0; i < l; i++) {
            count[s.charAt(i)]++; 
		/*for (int i : count) {
			count[s.charAt(i)]++;*/
		}
  
		
		//create an array of given to string size
		char ch[] = new char[s.length()];
		System.out.println("given string is :"+s);
		for (int i = 0; i < l; i++) {
	//	for (char i : ch) {
			
		
			ch[i] = s.charAt(i); 
			
			int k = 0;
			
			for(int j=0; j<=i; j++){
				if(s.charAt(i) == ch[j])
					k++;
			}
			
			if(k == 1)
				System.out.println("Number of times repeated character "+s.charAt(i) +" is :"+count[s.charAt(i)]);
		}
		
	}
}
<file_sep>/src/main/java/com/practice/sudocodes/PasswordValidator.java
package com.practice.sudocodes;
/**
 * 
 * @author ADMIN
 *Must contain at least one digit
 Must contain at least one of the following special characters @, #, $
Length should be between 6 to 8 characters.
 */

public class PasswordValidator {
    public static int display(String password){
    	//copied from google
if(password.matches(".*[0-9]{1,}.*") && password.matches(".*[@#$]{1,}.*") && password.length()>=6 && password.length()<=8)
                    {
                                    return 1;
                    }
                    else
                    {
                                    return -1;
                    }
       }
public static int dis(String pass){
	if(pass.matches(".*[0-9]{1,}.*")&&pass.length()==6){
		
		return 1;
	}
	
	else{
		
	}
	return -1;
		
	}
	
	

}
<file_sep>/src/main/java/com/task/sudocodes/EvenAndOddNumbers.java
package task.sudocodes;

import java.util.Scanner;
import java.util.function.Predicate;

public class EvenAndOddNumbers {

	static int x;
	@SuppressWarnings("resource")
	public static void main(String[] args) {
		System.out.print("please enter value of x(integers) :");
		Scanner scanner = new Scanner(System.in);
		int x = scanner.nextInt();
		if(x%2==0){
			System.out.println
			(x+" is a even number");
		}
		else{
			System.out.println(x+" is a odd number");
		}
		
		
	}
}
<file_sep>/src/main/java/com/practice/sudocodes/WelcomeJava.java
package practice.sudocodes;

public class WelcomeJava {
	public static void main(String[] args) {
		
		System.out.println("Welcome to java.");
		System.out.println("ready to write java programs.");
		
	}

}
<file_sep>/src/main/java/com/task/sudocodes/ReverseString.java
package task.sudocodes;
//reverse string in these program using for loop
import java.util.Scanner;

public class ReverseString {
	static String s;
	@SuppressWarnings("resource")
	public static void main(String[] args) {
		
		System.out.print("enter a string reverse :");
		Scanner scanner = new Scanner(System.in);
		String s = scanner.nextLine();
		String reverse = " ";
		
		for(int i= s.length()-1 ; i>=0;i--){
			reverse = reverse+s.charAt(i);
			
		}
		System.out.println("reverse of above string is : "+reverse);
	}

}

/*	System.out.print("enter a string :");
		Scanner scanner = new Scanner(System.in);
		String string = scanner.nextLine();
		String rev= "";
		System.out.print("reverse of string is :");
		for(int i =string.length()-1; i>=0; i--){
			
			rev = rev+string.charAt(i);
		}
		System.out.println(rev);*/<file_sep>/src/main/java/com/predicate/PredicateForEmpty.java
package com.predicate;

import java.util.function.Predicate;

public class PredicateForEmpty {

	public static void main(String[] args) {
		
		String name ="rakesh";
		String id = "";
		String sal = null;
		
		
		Predicate<String> p = t->t.isEmpty() || t==null;
		
		System.out.println(p.test(name));
		System.out.println(p.test(id));
		//System.out.println(p.test(sal));
		System.out.println("mahesh");
	}
}
<file_sep>/src/main/java/com/task/sudocodes/TablesMaths.java
package com.task.sudocodes;

import java.util.Scanner;

public class TablesMaths {

	private static final Scanner scanner = new Scanner(System.in);

    public static void main(String[] args) {
      /*  Integer N = scanner.nextInt();
     //   scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");
        String x1 = scanner.next();
        for(Integer c= 1; c<=10; c++){
        	Integer x=N*c;
        	String s = x.toString();
        	if(s.contains(x1)){
        		System.out.println();
        	}else {
        		System.out.println(N+" x "+c+" = "+x);}
			
        }*/
    	
//like();
reverse();
        scanner.close();
    }

	private static void reverse() {
		// TODO Auto-generated method stub
		
		
	}

	private static void like() {
		// TODO Auto-generated method stub
		 String x1 = scanner.next();
		 Integer x = scanner.nextInt();
		for(x=x;x>=0;--x){
			String s1 = x.toString();
			for(int i=s1.length();i>=0;i--){
				int s2=s1.charAt(i);
			}
			if(s2.contains(x1))
			System.out.print("");
			else
				System.out.println(x);
		}
		
	}
}
<file_sep>/src/main/java/com/task/sudocodes/DeadLockAvoid.java
package com.task.sudocodes;

public class DeadLockAvoid extends Thread{
	@Override
		public void run() {
	m2();
	
	m1();
		}
public static void main(String[] args) {
	Thread t = new Thread();
	t.start();
}
	public void m1() {
		synchronized (Integer.class) {
			
			System.out.println("aquired string class");
			synchronized (String.class) {
				System.out.println("aquired integer class");
				
			}
		}
		
	}
	public void m2() {
		synchronized (Integer.class) {
			System.out.println("aquired integer class");
			
			synchronized (String.class) {
				
				System.out.println("aquired string class");
			}
		}
	}
}
<file_sep>/src/main/java/com/immutable/CustomArraylist.java
package com.immutable;

import java.util.ArrayList;
import java.util.Comparator;

public class CustomArraylist implements Comparator<CustomArraylist> {

	public static void main(String[] args) {

		ArrayList<Integer> l = new ArrayList<>();
		l.add(12);
		l.add(1265);
		l.add(162);
		l.add(120);
		System.out.println();
	//Collections.sort(l, );
		
		System.out.println(l);
	}

	@Override
	public int compare(CustomArraylist a, CustomArraylist b) {
		// TODO Auto-generated method stub
		if (a == b) {
			return 0;
		}
		if (a != b) {
			System.out.println();
			return -1;
		} else {
			return 1;
		}
	}

}
<file_sep>/src/main/java/com/immutable/MyImmutable.java
package com.immutable;

public final class MyImmutable {
	private int mobile;
	private String name;
	public int getMobile() {
		return mobile;
	}
	public String getName() {
		return name;
	}
	public MyImmutable(int mobile, String name) {
		super();
		this.mobile = mobile;
		this.name = name;
	}
	
	public int modifydetails(int mobile){
		if(this.mobile==mobile)
		return mobile;
		else
			return new MyImmutable(mobile, name);
		/*if(this.mobile==mobile)
			
			return mobile;
		else
			
			return new MyImmutable(mobile, name);
		
		*/
		
	}
	
	

}
class test{
	public static void main(String[] args) {
		MyImmutable im = new MyImmutable(954545, "battu");
		MyImmutable mm = im.modifydetails(954545);
		System.out.println(mm.getMobile());
	}
	
}<file_sep>/src/main/java/com/function/Studentgrades.java
package com.function;

import java.util.ArrayList;
import java.util.function.Function;

public class Studentgrades {

	
	public static void main(String[] args) {
		
		
		ArrayList<StudentPojo> list = new ArrayList<>();
		list.add(new StudentPojo("ameer", 100, "vittalacharya", 960));
		list.add(new StudentPojo("gareeb", 101, "vittalacharya", 460));
		list.add(new StudentPojo("jareeb", 104, "vittalacharya", 860));
		list.add(new StudentPojo("kareeb", 102, "vittalacharya", 679));
		list.add(new StudentPojo("aayub", 106, "vittalacharya", 963));
		list.add(new StudentPojo("masthan", 105, "vittalacharya", 954));
		list.add(new StudentPojo("mujafar", 103, "vittalacharya", 500));
		
		Function<StudentPojo, Character> grade = s->{
			if(s.getMarks()>850)
				return 'A';
			else if(s.getMarks()>750)
				return 'B';
			else if(s.getMarks()>=500)
				return 'c';
			else 
				return 'F';
		};
		
		for (StudentPojo gradelist : list) {
			System.out.println(gradelist+" grade-"+grade.apply(gradelist));
			
		}
	}
		
	}


<file_sep>/src/main/java/com/practice/sudocodes/FactorialProgram.java
//Factorial Program in Java: Factorial of n is the product of all positive descending integers. Factorial of n is denoted by n!. For example:


package com.practice.sudocodes;

import java.util.Scanner;

public class FactorialProgram {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
	System.out.println("enter a number to find facorial");
	Scanner sc = new Scanner(System.in);
		int number = sc.nextInt();
		int factorial = 1;
		for (int i = 1; i <= number; i++) {
			factorial=factorial*i;
			
		}
		System.out.println(number+" factorial is : "+factorial);
	}

}
<file_sep>/src/main/java/com/serializable/Serialize.java
package com.serializable;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.ObjectOutputStream.PutField;

public class Serialize {

	
	@SuppressWarnings("resource")
	public static void main(String[] args) throws Exception{
		/*Student s1 = new Student("Raju", 100, "Siei", "eeraptnam");
	
		FileOutputStream fio = new FileOutputStream("F:\\New folder (3)\\Peru.txt");
		System.out.println("file created");
		ObjectOutputStream obj = new ObjectOutputStream(fio);
		obj.writeObject(s1);
		System.out.println("end");
obj.close();	*/	
		
		FileInputStream fis = new FileInputStream("F:\\New folder (3)\\Peru.txt");
		System.out.println("file loaded");
		ObjectInputStream oi= new ObjectInputStream(fis);
		
		Student s2 = (Student) oi.readObject();
		System.out.println(s2);
		System.out.println("file read succesefull");
				
	}}<file_sep>/src/main/java/com/predicate/PredicateLambda.java
package com.predicate;

import java.util.function.Predicate;

public class PredicateLambda {

	public static void main(String[] args) {
		
		Predicate<Integer> p = i->i%2==0;
		
		System.out.println(p.test(2561
				+6469597));
		System.out.println(p.test(256119665));
		System.out.println(p.test(25666));
		
	}
}
