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
public class Swastik {
public static void main(String...args){
int n=9;
int mid=(n+1)/2;
for(int i=1 ; i<=n ; i++) {
for(int j=1 ; j<=n ; j++) {
if( j==mid i==mid (i==1 && j>mid) (i<= mid && j==1) (i == n && j<=mid) || (i>= mid && j==n))
System.out.print("*");
else
System.out.print(" ");
}
System.out.println();
}
}
}
import java.util.Scanner;

public class kShapeAlphabets1 {

private static Scanner sc;

public static void main(String[] args) {

sc = new Scanner(System.in);
int i, j, alphabet;

System.out.print("Enter K Shape Alphabets Pattern Rows = ");
int rows = sc.nextInt();

System.out.println("Printing K Shape Alphabets Pattern");

for (i = rows - 1; i >= 0; i-- )
{
alphabet = 65;
for (j = 0 ; j <= i; j++ )
{
System.out.print((char)(alphabet + j) + " ");
}
System.out.println();
}

for (i = 1 ; i < rows; i++ )
{
alphabet = 65;
for (j = 0 ; j <= i; j++ )
{
System.out.print((char)(alphabet + j) + " ");
}
System.out.println();
}
}
}
public class StringImmutable {

public static void main(String[] args) {
String str1 = "Hello";
String str2 = "World";

// Concatenating two strings
String str3 = str1.concat(str2);

// printing the result
System.out.println("String after concatenation = " + str3);

// changing the original strings
str1 = str1.concat("123");
str2 = str2.concat("456");

// printing the modified strings
System.out.println("String1 after modification = " + str1);
System.out.println("String2 after modification = " + str2);

// printing the final result
System.out.println("Final String after concatenation = " + str3);
}
}
import java.io.*;
public class CountChar
{

public static void main(String[] args) throws IOException
{
String ch;
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter the Statement:");
ch=br.readLine();
int count=0,len=0;
do
{
try
{
char name[]=ch.toCharArray();
len=name.length;
count=0;
for(int j=0;j<len;j++)
{
if((name[0]==name[j])&&((name[0]>=65&&name[0]<=91)(name[0]>=97&&name[0]<=123)(name[0]>=48&&name[0]<=57)))
count++;
}
if(count!=0)
System.out.println(name[0]+" "+count+" Times");
ch=ch.replace(""+name[0],"");
}
catch(Exception ex){}
}
while(len!=1);
}
👍1
Allowing copy message
Forwarded from Java Hyd Team
Spring BOOT 👢🥾 STARTED
public class ReverseWordsInSentence {
public static void main(String[] args) {
String sentence = "which is the biggest continent";
String[] words = sentence.split(" ");
String reversedSentence = "";
for (int i = 0; i < words.length; i++) {
String word = words[i];
String reversedWord = "";
for (int j = word.length() - 1; j >= 0; j--) {
reversedWord = reversedWord + word.charAt(j);
}
reversedSentence = reversedSentence + reversedWord + " ";
}
System.out.println(reversedSentence);
}
}
public class Q29_1 {
static void printAllSubsets(int[] A, int K) {
int N = A.length;
for (int i = 0; i < (1 << N); i++) {
int sum = 0;
for (int j = 0; j < N; j++) {
if ((i & (1 << j)) > 0)
sum += A[j];
}
if (sum == K) {
for (int j = 0; j < N; j++) {
if ((i & (1 << j)) > 0)
System.out.print(A[j] + " ");
}
System.out.println();
}
}
}
public static void main(String[] args) {
int[] A = {0, 1, 2, 3, 5, 6, 7, 11, 12, 14, 20};
int K = 7;
printAllSubsets(A, K);
}
}
👍1
A surprise for everyone here just open this link 🖇️ get everything for your practice don't miss this



https://drive.google.com/drive/folders/1aeAAl5C-HdkXzQMxLjpbkbNuCdytAsdW



https://drive.google.com/drive/folders/1IYTKzuGY6GxAujrQA-Tucv-KBt6v2RQq
Two drive links