Frequently asked Java Programs (Series): 1. Swap two Number 2. Reverse a Number 3. Reverse a String 4. Palindrome Number 5. Palindrome String 6. Count number of Digits in a Number 7. Count number of even and odd digits 8. Count sum of digits in a number 9. Find largest of 3 numbers 10. Generate Fibonacci Series 11. Check given number is Prime or Not 12. Generate Random number 13. Factorial of a number 14. Find Sum of Elements in Array 15. Print Even & Odd numbers from an Array 16. Check the Equality of two Arrays 17. Missing number in an Array 18. Minimum & Maximum values in Array 19. Duplicate Elements in Array 20. Searching an Element in Array (Liner Search) 22. Searching an Element in Array (Binary Search) 23. Sort Elements in Array (Bubble Sort) 24. Sort Elements in Array (Built-In Sort) 25. Remove Junk or Special Characters in String 26. Remove White Spaces in String 27. Count occurrences of a character in a String 28. Count Words in a String 29. Reverse each word in a String 30. Read Data from a Text File 31. Write Data into a Text File
Although 4:04 is simple math it really shows you problem solving skills and thinking outside the box. Once you can come up with these solutions on your own you are one big step along the coding way!
Thank you so much for your explanation sir. Easy to understand and easy to analyze also,even non-programmer also should understand easy way of your explanation sir.
Hey riya, Mostly you follow which playlist i have done java now im doing collection framework next what should i do follow within few days i have interview also i want to crack that interview??
Hi, just want to point out that the XOR operation you did is wrong even if answer is right.. you can't put -/0 in end! It will change the value of binary number and in XOR if bit are same result is 0 not 1.. it should be as follows - 10 -> 1010 = 01010 20 -> 10100=10100 ------------------------------- 11110 XOR Logic is simple if bits are same result is 0. Anyways great series. 🤚
Hi Pawan, Thanks for all your videos on FAQ. I think expression in last logic is still evaluated from Left to Right e.g. 10+20-(20). If a=b is executed first then both variables a and b will have same value 20 and expression will result in (20+20-20). Thanks
i knew three ways of doing this program of swap two numbers i didnt know we can use exor and that single statement. But the logic was good, it works well but which has less time complexity is it logic 1 and logic two????
can you explain this question please sir Secure Vault is a lock manufacturing company, they are not doing so great. Recent crime statistics show that this company's lock is behind most of the successful robberies. They are not making distinct keys for all locks. A lock with key number 10 can be opened with all the other 1,2,5 numbered keys. Cops asked you to write a program for finding similar keys so that people can be alerted and they can change their lock. Input format: the input contains the single integer n. input constraints: 1
Sir in last apprach a+b - (a=b) .. when we assigning the value of b to a then a variable will be updated in program then while coming to a+b is should be actually 20 + 20 naa🥲🥲..
Your explanation is wrong at 11:04 to 11:07 The correct is *if both bits are same it returns 0 otherwise it returns 1.* a = 10 = 01010 b = 20 = 10100 a = a^b = 01010 ^ 10100 = 11110 = 30 b = a^b = 11110 ^ 10100 = 01010 = 10 a = a^b = 11110 ^ 01010 = 10100 = 20 I like logic 4 & 5. I appreciate you...
hello sir how toi write this program this is my interview question from IBM ...........Write a function that takes in a non-empty array of distinct integers and an integer representing a target sum, The function should find all triplets in the array that sum up to the target sum and print all the triplets. The numbers in each triptlet should be ordered in ascending order, and the triplets themselves should be ordered in ascending order with respect to the numbers triplets. If no three number sum, the function should return an empty array. Input = [8,10,-2,49,14] Target sum : 57 Output: [[10,-2,49]]
11:11 u complete made us confused. You can not take a 0 at last .and 0+1 will give you 1 or vice versa in xor . Although the result is correct but u explained wrong.
For printing the multiple variables at a time in one statement, we have to concanate in between both variables so we can make a space also when printing these variables.
Hello sir... your teaching is amazing...I am struggling to write a code for a java program...can you please help me out WAP to read value to an array except multiple of three position. Where multiples of three position will have sum of previous two values a[0] = 1 a[1] = 2 a[2] ///Skip dont read; values should be 3 = 2 + 1 a[3] = 5 a[4] = 6 a[5] ///Skip dont read; values should be 11 = 6 + 5 a[6] = 1 a[7] = 1 a[8] ///Skip dont read; values should be 2 = 1 + 1
here is a code i kw its been a long any way public class Main { public static void main(String[] args) { int[] a = new int[]{1, 2, 0, 5, 6, 0, 1, 1, 0}; for (int i = 2; i < a.length; i += 3) { a[i] = a[i-1] + a[i-2]; } System.out.println(Arrays.toString(a)); } }
I have one java programming question to solve I give Input as 5 And type random binary numbers as input 1 0 1 1 1 My output should convert that binary number to decimal number 23
Although I already met swapping values lots of times, It was interesting to watch other ways of this process, I’m impressed. Thanks for the video!
::learning new ways of swapping from your videos. lil correction, at 11:49 extra zero should be put on the left side , then result will come as 30.
Frequently asked Java Programs (Series):
1. Swap two Number
2. Reverse a Number
3. Reverse a String
4. Palindrome Number
5. Palindrome String
6. Count number of Digits in a Number
7. Count number of even and odd digits
8. Count sum of digits in a number
9. Find largest of 3 numbers
10. Generate Fibonacci Series
11. Check given number is Prime or Not
12. Generate Random number
13. Factorial of a number
14. Find Sum of Elements in Array
15. Print Even & Odd numbers from an Array
16. Check the Equality of two Arrays
17. Missing number in an Array
18. Minimum & Maximum values in Array
19. Duplicate Elements in Array
20. Searching an Element in Array (Liner Search)
22. Searching an Element in Array (Binary Search)
23. Sort Elements in Array (Bubble Sort)
24. Sort Elements in Array (Built-In Sort)
25. Remove Junk or Special Characters in String
26. Remove White Spaces in String
27. Count occurrences of a character in a String
28. Count Words in a String
29. Reverse each word in a String
30. Read Data from a Text File
31. Write Data into a Text File
Really 😮😮
Fibonacci series using recursion
thannks
😊😊
th-cam.com/video/ZGzt3XtaJ-g/w-d-xo.html
Although 4:04 is simple math it really shows you problem solving skills and thinking outside the box. Once you can come up with these solutions on your own you are one big step along the coding way!
th-cam.com/video/ZGzt3XtaJ-g/w-d-xo.html
1:36 Using third variable
3:18 Using + and - Operators
5:23 Using * and / Operators
8:22 Using Bitwise XOR(^) Operator
14:22 In a Single Statement
The last one is so clever I will use it from now on great video!
Glad you liked it!
th-cam.com/video/ZGzt3XtaJ-g/w-d-xo.html
Thank you so much sir. Your video made me get placed in a Multicoreware product company 💯❤️✌️
It's very impressive series that i have seen. I don't have words to explain about this series. Thanks a lot❤
Welcome
Thank you so much for your explanation sir. Easy to understand and easy to analyze also,even non-programmer also should understand easy way of your explanation sir.
You are most welcome
Cool ...Swapping in one statement makes sense ))
your training is silpmly like a wow....thanks
My pleasure!
th-cam.com/video/ZGzt3XtaJ-g/w-d-xo.html
Great playlist Sir😀 I got a job switch just going through your playlist. Thank u so much!
Hey riya, Mostly you follow which playlist i have done java now im doing collection framework next what should i do follow within few days i have interview also i want to crack that interview??
U mean 30 carat 20 ???? Please ^ = carat
@@nishantsharma6435 Which career u r willing to join? Is it SQA??
@@John12685 hey tayyab I'm looking for project engineer role?
@@nishantsharma6435 U mean software development?
Hi, just want to point out that the XOR operation you did is wrong even if answer is right.. you can't put -/0 in end! It will change the value of binary number and in XOR if bit are same result is 0 not 1..
it should be as follows -
10 -> 1010 = 01010
20 -> 10100=10100
-------------------------------
11110
XOR Logic is simple if bits are same result is 0.
Anyways great series. 🤚
U r absolutely right bro👍🏻
yes
i was held in confusion , u cleared it thanks.
thank you sir..please make all JAVA related programming interview questions.
th-cam.com/video/ZGzt3XtaJ-g/w-d-xo.html
Hi Pawan, Thanks for all your videos on FAQ. I think expression in last logic is still evaluated from Left to Right e.g. 10+20-(20). If a=b is executed first then both variables a and b will have same value 20 and expression will result in (20+20-20). Thanks
then should is be like b = (a+b)-(a=b);
U mean 30 carat 20 ???? Please ^ = carat
Hello sir your explaination is best, please create videos on pattern questions pleasseee🙃
Super sir... Keep doing more programs like this.. The main key in this video is explaining skills and different logics...thank you very much..
Welcome
Thanks for the easy explanation but the logic of calculating XOR is not Right. please make corrections.
Main soch raha tha ki 1^1=1
Kab se hone laga
1^1=0
Wah bhai wah kya soch he tumari😂
You are an excellent teacher, I am really impressed!
Thank you
@@sdetpavan how can we do this
Cn u please tell me the software name
15:50 if assignment operator operates from right to left then after (a=b) , the a+b= will be 40 right? why we have to take it as 10 again??
thank you, this is very helpful information
Thanks for your clarity explanation sir thank you so much 😁
Watching 3 hour before exam 😂
Thankyou sir 🙏🙏
Welcome
th-cam.com/video/ZGzt3XtaJ-g/w-d-xo.html
Sir you are doing amazing job 👏.
Hats of to you Sir ❤.
Thanks
th-cam.com/video/ZGzt3XtaJ-g/w-d-xo.html
Wow.. these many ways to do SWAP?....really good to know different ways..Your way of teaching/explaining really really awesome
Thank you so much for your feedback. Please share my videos with your friends or colleagues.
@@sdetpavan U mean 30 carat 20 ???? Please ^ = carat
The most easiest explanation heard ever 💥💥🤗🤗
thanks
ur the best sir
Really it's amazing explanation😍 sir plz can u upload the STRING, ARRAYS, MATRIX and CONVERSATION programs.
th-cam.com/video/ZGzt3XtaJ-g/w-d-xo.html
U r great sir loved it👍👍
Welcome
sir your way of teaching is very good. The way you explain the program is so nice.
th-cam.com/video/ZGzt3XtaJ-g/w-d-xo.html
thnq so much sir for providing such an amezing platform to us
Welcome
th-cam.com/video/ZGzt3XtaJ-g/w-d-xo.html
Thank you sir very nice explanation
Welcome
love and respect from Afghanistan.
My pleasure
Amazing 🎉
Thanks
Well teacher sir...
Thanks
i knew three ways of doing this program of swap two numbers i didnt know we can use exor and that single statement. But the logic was good, it works well but which has less time complexity is it logic 1 and logic two????
Superb!
Thanks
USEFUL👍👍
Thank you so much sir 🙏
Most welcome
11:09 if both are equals it return 0 but you say return 1 in xor operation
u r lit Sir. Respect
thank you very much sir for these lectures these are very useful for us
th-cam.com/video/ZGzt3XtaJ-g/w-d-xo.html
I like the last logic. Thanks
You’re welcome
Thank you sir, it's an useful information.
You are welcome
amazing sir helpful videos
thanks
Tnq sir... Nice teaching
Always welcome
wow Sir thank you
remembering the math days formula😍
You are most welcome
Thank you a lot for this videos
Glad you like them!
You did one mistake at 11:00 . When both are same Output should be Zero.
yes same me too notice
Yes, in table and prgm sir used diff logic
Iam also noticed that mistake
Iam also noticed
Excellent sir
Thanks
thanks for you videos
Welcome
last one is dope 🔥🔥🔥
I like it!!🙏
Thanks
can you explain this question please sir
Secure Vault is a lock manufacturing company, they are not doing so great. Recent crime
statistics show that this company's lock is behind most of the successful robberies. They are
not making distinct keys for all locks. A lock with key number 10 can be opened with all the
other 1,2,5 numbered keys. Cops asked you to write a program for finding similar keys so
that people can be alerted and they can change their lock.
Input format: the input contains the single integer n.
input constraints: 1
Thank you so much sir
Most welcome
Thank you sir Ji
Sir very nice explanation please do all possible programs in Java for interview
Sir in last apprach a+b - (a=b) .. when we assigning the value of b to a then a variable will be updated in program then while coming to a+b is should be actually 20 + 20 naa🥲🥲..
th-cam.com/video/ZGzt3XtaJ-g/w-d-xo.html
Thanks brother
welcome
Its too nice
Your explanation is wrong at 11:04 to 11:07
The correct is *if both bits are same it returns 0 otherwise it returns 1.*
a = 10 = 01010
b = 20 = 10100
a = a^b = 01010 ^ 10100 = 11110 = 30
b = a^b = 11110 ^ 10100 = 01010 = 10
a = a^b = 11110 ^ 01010 = 10100 = 20
I like logic 4 & 5.
I appreciate you...
Yes
That's what I was Finding
Hi, just wanted to check if this logic can be used to swap the numbers?
int a, b; a = 10; b = 20; a+=10; b-=10;
Please confirm.
hello sir can you tell me how to slove the problem "= cnnot resolve the veriable "d
shows in java
Nice sir.. Please cover all programs related to string..
very good approach to lure all the people who thought programming was boring
th-cam.com/video/ZGzt3XtaJ-g/w-d-xo.html
That's nuts. I would never ask such a stupid question in an interview.
last method is awesome
thanks
Hi sir any pdf available whole programs and java course in your class
thank you ...
Welcome
Hi Sir, please add problem regarding to Permutation of Numbers in Java
XOR was amazing.
Thanks
hello sir how toi write this program this is my interview question from IBM ...........Write a function that takes in a non-empty array of distinct integers and an integer representing a target sum, The function should find all triplets in the array that sum up to the target sum and print all the triplets. The numbers in each triptlet should be ordered in ascending order, and the triplets themselves should be ordered in ascending order with respect to the numbers triplets.
If no three number sum, the function should return an empty array.
Input = [8,10,-2,49,14]
Target sum : 57
Output: [[10,-2,49]]
very satisfied
thanks
Sir apne XOR me both equal hai to 0 bataye diagram me or coding me both equal h to 1 count kiye , nhi smjhe? Koe mistake hua? Ya mujhe smjh ni aaya
While explaining binary, 0 should come first, and xor operation you explained wrong(Time11:22)
11:11 u complete made us confused. You can not take a 0 at last .and 0+1 will give you 1 or vice versa in xor . Although the result is correct but u explained wrong.
Thank u sir for all the videos... Sir please explain us how to convert number to word format... Please sir....
th-cam.com/video/ZGzt3XtaJ-g/w-d-xo.html
int a=10, b=20;
sir ,it is correct or not
int x = a>b? a : b ;
System.out.println("a"+x);
int y = a
Sire You are a great teacher!!! Thank You for all your work! Cod bless You!
Welcome
@@sdetpavan Where can i download the codes. Pls provide GitHub link
Sir it shows " module java is not found" in the output of the program...?? What is the problem sir..!??
Which ide you are using.
sir this 30 problems are enough for a manual tester to get a job with two years of experience could u please reply to my comment sir
Can you please help
صلي علي النبي❤
Sir, XOR operations you did in wrong way please correct it or trim the video, the ZERO should be added on the left side
Can anyone explain on a^b such that a equal to 10 and b equal to 20 , as he told oppositely
Can you WAP for , if input is demo and expected output is deemmmoooo
You showed in the X-OR table 0 0 becomes 0 and 1 1 becomes 0 but in the explanation u told opposite.
The "dash" is at start and not at last. Sir's mistake.
Nice one.
Thanks
Sir if you dont mind Can you please share your Git link with these programming
sir what is the use of "+a+" "+b
i could not understand this concept
th-cam.com/video/ZGzt3XtaJ-g/w-d-xo.html
For printing the multiple variables at a time in one statement, we have to concanate in between both variables so we can make a space also when printing these variables.
RESPECTED SIR,I NEED RECURSION VIDEO IN JAVA PLEASE IMMEDIATELY UPLOAD.I CANT UNDERSTAND OTHER'S PLEASE HELP ME SOON.
My 4 key doesn't work, it just types 23 or pressed 2 and 3 very quickly, I'm so lost! Is there a fix to that?
Get a new keyboard
Can you please share programs in your comments section?
Hello sir... your teaching is amazing...I am struggling to write a code for a java program...can you please help me out
WAP to read value to an array except multiple of three position.
Where multiples of three position will have sum of previous two values
a[0] = 1
a[1] = 2
a[2] ///Skip dont read; values should be 3 = 2 + 1
a[3] = 5
a[4] = 6
a[5] ///Skip dont read; values should be 11 = 6 + 5
a[6] = 1
a[7] = 1
a[8] ///Skip dont read; values should be 2 = 1 + 1
here is a code i kw its been a long any way
public class Main {
public static void main(String[] args) {
int[] a = new int[]{1, 2, 0, 5, 6, 0, 1, 1, 0};
for (int i = 2; i < a.length; i += 3) {
a[i] = a[i-1] + a[i-2];
}
System.out.println(Arrays.toString(a));
}
}
Single statement doesn't give the output sir
I have one java programming question to solve
I give Input as 5
And type random binary numbers as input
1
0
1
1
1
My output should convert that binary number to decimal number 23
Why you in a for +a +b
U mean 30 carat 20 ???? Please ^ = carat
what is that noise 11 minute
XOR logic wrong hai
Yes.... Sir xor logic is wrong
Yeah...! i got that too thanks for clarification.