Java Hyd Team
746 subscribers
986 photos
39 videos
670 files
690 links
https://teamhydteam.my.canva.site/

Can visit us on our website ๐Ÿ˜Š
Still working on it ๐Ÿ˜Š
Download Telegram
Java Hyd Team
December 11 ๐Ÿ˜Š๐Ÿ˜Š
Conducting for 3hour only will explain how to program and one question of last session (what's the real-time implementation of abstract classes ). 10am -1 pm
Timing 10-11am only
Old members check your calendar updated there
Next Sunday again we will be covering core java, advance java, Spring and spring boot , React-Js
Java Hyd Team pinned ยซNext Sunday again we will be covering core java, advance java, Spring and spring boot , React-Jsยป
public static void main(String[] args) {
double a ,b ;
a= System.currentTimeMillis();
List<Double> list = of(1, 1000000000).boxed().collect(Collectors.toList());
list.forEach(obj -> System.out.print(obj));
b=System.currentTimeMillis();
System.out.println(b-a);
}
}
๐Ÿ‘1
execute this code
Not conducting today some work is there will schedule for next Sunday
Or in lab we will cover of get time
package com.Aman;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

import java.util.stream.LongStream;
import static java.lang.System.currentTimeMillis;
import static java.util.stream.DoubleStream.of;
public class Billions {
/* public static void main(String[] args) {
double n=0;
do{
System.out.println(n);
n+=1;
}while(n<100000000);
}*/
// public static void main(String[] args) {
/*double a ,b ;
a= currentTimeMillis();
List<Double> list = of(1, 1000000000).boxed().toList();
list.forEach(System.out::println);
b= currentTimeMillis();
System.out.println(b-a);
}*/
/* public static void main(String[] args) {
double a ,b ;
a= currentTimeMillis();
// Using Java 8 Stream API to print 1 billion numbers
IntStream.range(1, 1000000000).forEach(System.out::println);
b= currentTimeMillis();
System.out.println(b-a);
}
}*/
//}

public static void main(String[] args) {
long count = IntStream.rangeClosed(1,1000000000).parallel().count();
System.out.println(count);
}

}
uncomment and run the programs
import java.util.*;
public class _7_12_2022 {
public static void main(String[] args) {
String a = "sathyaa";
Map<Character, Integer> m = new HashMap<>();
for(int i = 0; i < a.length(); i++){
if(m.containsKey(a.charAt(i))){
m.put(a.charAt(i), m.get(a.charAt(i))+1);
} else {
m.put(a.charAt(i), 1);
}
}
System.out.println(m.toString());

/*String s = "aabbcbabadchisidb";
Map<Character, Integer> m = new HashMap<>();

for(int i = 0; i < s.length(); i++){
if(m.containsKey(s.charAt(i))){
m.put(s.charAt(i), m.get(s.charAt(i))+1);
} else {
m.put(s.charAt(i), 1);
}
}
Collection<Integer> a = m.values();
int max = Collections.max(a);
for(Character ch : m.keySet()){
if(m.get(ch)==max){
System.out.println(ch+"-"+m.get(ch));
}
}
*/
}

}
๐Ÿ‘1
public class String_Palidrome {
//create class (class doesn't allocate space
public static void main(String[] args) {
//main method allocates space for the project in heap
String inputString = "paap";
//declaring and initializing string value
int length = inputString.length();
// initializing length with array value length
int i, begin, end, middle;
// declaring variable in int datatype
begin = 0;//initializing variable with value
end = length - 1;//initializing variable with value
middle = (begin + end) / 2;//initializing variable with value
for (i = begin; i <= middle; i++) { // for loop
if (inputString.charAt(begin) == inputString.charAt(end)) { //conditional blocks
begin++; // post increment after
end--; // post decrement after
} else { //conditional blocks
System.out.println("Not a palindrome.");//output statement
break; // breaks statement
}
}
if (i == middle + 1) { //conditional blocks
System.out.println("Palindrome."); // output statement
}
}
}
public class RemoveDuplicates {
public static void main(String[] args) {
String str = "sathya";
RemoveDuplicates obj = new RemoveDuplicates();
System.out.println(obj.removeDuplicates(str));
}
public String removeDuplicates(String s) {
char[] chars = s.toCharArray();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < chars.length; i++) {
String str = String.valueOf(chars[i]);
if (!sb.toString().contains(str)) {
sb.append(str);
}
}
return sb.toString();
}
}
import java.util.Arrays;

public class Anagram {
public static void main(String[] args) {
String str1 = "silent";
String str2 = "lister";
boolean status = true;
if (str1.length() != str2.length()) {
status = false;
} else {
char[] arr1 = str1.toLowerCase().toCharArray();
char[] arr2 = str2.toLowerCase().toCharArray();
Arrays.sort(arr1);
Arrays.sort(arr2);
status = Arrays.equals(arr1, arr2);
}
if (status) {
System.out.println("Strings are anagrams");
} else {
System.out.println("Strings are not anagrams");
}
}
}
package com.Aman;
import java.util.Scanner;
public class CompareStrings {
public static void main(String[] args) {
Scanner x = new Scanner(System.in);
System.out.println("Enter two strings");
String str1 = x.next();
String str2 = x.next();

// Compare two strings in length
int result = str1.compareTo(str2);

if(result < 0) {
System.out.println("String 1 is shorter than String 2");
} else if(result == 0) {
System.out.println("String 1 and String 2 are equal in length");
} else {
System.out.println("String 1 is longer than String 2");
}
}
}
import java.util.Scanner;
public class Armstrong {
public static void main(String[] arg) {
int a,arm=0,n,temp;
Scanner sc=new Scanner(System.in);
System.out.println("Enter a number");
n=sc.nextInt();
temp=n;
for( ;n!=0;n/=10 )
{
a=n%10;
arm=arm+(a*a*a);
}
if(arm==temp)
System.out.println(temp+" is a armstrong number ");
else
System.out.println(temp+" is not a armstrong number ");
}
}
import java.util.Scanner;
public class FloyidsTriangle {
public static void main(String[] args){
int n,i,j,k = 1;
System.out.println("Enter the number of lines you need in the FloyidsTriangle");
Scanner sc = new Scanner(System.in);
n = sc.nextInt();
for(i = 1; i <= n; i++) {
for(j=1;j <= i; j++){
System.out.print(" "+k++);
}
System.out.println();
}
}
}