public class RemoveDuplicates {
public static void main(String[] args)
{
String str = "Sathya";
int l = str.length();
int k = 0;
char[] temp = new char[l];
boolean[] hit = new boolean[256];
for (int i = 0; i < l; i++) {
char ch = str.charAt(i);
if (!hit[ch]) {
hit[ch] = true;
temp[k++] = ch;
}
}
String res = new String(temp, 0, k);
System.out.println(res);
}
}
public static void main(String[] args)
{
String str = "Sathya";
int l = str.length();
int k = 0;
char[] temp = new char[l];
boolean[] hit = new boolean[256];
for (int i = 0; i < l; i++) {
char ch = str.charAt(i);
if (!hit[ch]) {
hit[ch] = true;
temp[k++] = ch;
}
}
String res = new String(temp, 0, k);
System.out.println(res);
}
}
//Write a java program accept date of birth from scanner and check eligible for vote ?
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter date of birth in format dd/mm/yyyy : ");
String dob = sc.nextLine();
String[] dobArray = dob.split("/");
int day = Integer.parseInt(dobArray[0]);
int month = Integer.parseInt(dobArray[1]);
int year = Integer.parseInt(dobArray[2]);
if(year < 1950)
{
System.out.println("You are not eligible for vote.");
}
else if(year == 1950 && month < 1)
{
System.out.println("You are not eligible for vote.");
}
else if(year == 1950 && month == 1 && day <18)
{
System.out.println("You are not eligible for vote.");
}
else
{
System.out.println("You are eligible for vote.");
}
}
}
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter date of birth in format dd/mm/yyyy : ");
String dob = sc.nextLine();
String[] dobArray = dob.split("/");
int day = Integer.parseInt(dobArray[0]);
int month = Integer.parseInt(dobArray[1]);
int year = Integer.parseInt(dobArray[2]);
if(year < 1950)
{
System.out.println("You are not eligible for vote.");
}
else if(year == 1950 && month < 1)
{
System.out.println("You are not eligible for vote.");
}
else if(year == 1950 && month == 1 && day <18)
{
System.out.println("You are not eligible for vote.");
}
else
{
System.out.println("You are eligible for vote.");
}
}
}
Sony is Hiring Machine learning Intern
Role - Machine learning Intern
Experience: Student/fresher
Salary - 40k - 50k per month
Passout year - 2024,2023 ,2022
Qualification: Btech/BE/Mtech/MCA
Location: Work from home
Apply now: https://www.linkedin.com/jobs/view/3352394311
Role - Machine learning Intern
Experience: Student/fresher
Salary - 40k - 50k per month
Passout year - 2024,2023 ,2022
Qualification: Btech/BE/Mtech/MCA
Location: Work from home
Apply now: https://www.linkedin.com/jobs/view/3352394311
Linkedin
Sony Research India hiring Machine Learning Intern in Mumbai, Maharashtra, India | LinkedIn
Posted 11:00:43 AM. The Sony R&D Centre is the research and development organization within Sony Group Corporation. Weβ¦See this and similar jobs on LinkedIn.
Java Hyd Team
import java.util.Scanner; class ReverseWords { static void reverseWords(String str) { String[] arr = str.split("\\s"); for (int i = arr.length-1; i >= 0; i--) { Syβ¦
package com.Aman;import java.util.*;import java.util.regex.Pattern;public class Q1_A4 { // Java Program to reverse a String// without using inbuilt String function // Method to reverse words of a String static String reverseWords(String str) { // Specifying the pattern to be searched Pattern pattern = Pattern.compile("\\s"); // splitting String str with a pattern // (i.e )splitting the string whenever their // is whitespace and store in temp array. String[] temp = pattern.split(str); String result = ""; // Iterate over the temp array and store // the string in reverse order. for (int i = 0; i < temp.length; i++) { if (i == temp.length - 1) result = temp[i] + result; else result = " " + temp[i] + result; } return result; } // Driver methods to test above method public static void main(String[] args) { String s1 = "There is a Cat"; System.out.println(reverseWords(s1)); String s2 = " Cat is there"; System.out.println(reverseWords(s2)); }}