Java Tutorial: Chapter 1- Practice Set | Java Practice Problems With Solution

preview_player
Показать описание
Java Programming Tutorial: In this video, I have solved few question from the Chapter 1 Practice Set. This practice set will contain all the questions for practice from our chapter 1: Variables and data types

Best Hindi Videos For Learning Programming:

►C Language Complete Course In Hindi -

►JavaScript Complete Course In Hindi -

►Django Complete Course In Hindi -

Follow Me On Social Media
Рекомендации по теме
Комментарии
Автор

Ho sake to share kar dena Java Course Ki Playlist, Please!

CodeWithHarry
Автор

Harry The things u are doing no one can do the amount of hardwork you are doing for us 🙏🏻🙏🏻🙏🏻 Hats off

shubhammodicool
Автор

8:08 As I am from python lang., I knew that strings can be separated inside the print statement by commas(, ), but in JAVA now I came to know that + is to be given to separate two strings in the print statement. Thanks a lot for it, btw as I got error in that separation of strings I tried a new method which I want to share.

System.out.print("Enter your name:");
String str1 = S.next();
System.out.print("Hello, ");
System.out.print(str1);
System.out.print(" Have a nice day");

Thought of making in the same line which is required in the output, which can be done by just removing ln from print statement, so I did like that. I hope if anyone is seeing can understand it along with it's essence.
Thanks a lot Harry .❤❤

KoushikDas
Автор

Thanks Harry Hats
Q-4 Ans

System.out.println("Enter Km Value");
Scanner sc = new Scanner(System.in);
float km = sc.nextFloat();
float mile = (float) 0.621371;
float multiply = km * mile;

System.out.println("Ans Mile : " + multiply);

niteshshirke
Автор

8:30 Float can't be used here . As the mile conversion unit is a long decimal, so Double is to used here for our convenience. I did float input in Km to m, but it came as error in conversion of Km to miles, so I came to know of my another mistake here.

System.out.println("Enter Distance in Kilometers:");
double a=S.nextDouble() ;
double b = a*0.621371;
System.out.println("Distance in miles is:");
System.out.println(b);


Got the correct answer now. Thanks a lot, Harry brother


Edit : float can also be done

KoushikDas
Автор

repect:
Printf("Sir Please Continue Teaching us .");
If(Sir You continue Taching us){
HappY Teachers Day Sir ..Wish You all the best for you hard work..
And keep it up sir
}else{
goto repect;
}

tarabelbase
Автор

FEELING HAPPY AFTER COMPLETING THIS PRACTICE I WAS ABLE TO SOLVE MOST BY MY ONE
ONLY BECAUSE OF YOU
THANKS A LOT....BRO

rkbrothers
Автор

REALLY I AM LEARNING MORE ON YOUTUBE THAN MY COLLAGE.
WE ALL APPRECIATE TO YOU ABOUT YOUR WORK.
FOREVER

atharvatoundakar
Автор

Mai paid subscription bhi le raha hu but jitna focus apki classes pr karta hu mujhe bhot ache se samjh aata hai Thankyou Sir❤️🙏

bhanupandit
Автор

4:17 Yes, float/double should be used . I did the same mistake when I was solving the question of last challenge (5 subjects CGPA). I then thought of the decimal answer and then converted each input into float data type.
IDK why you are not taking user input process but that is the actual process which everyone should follow, although by taking direct input it will be easy for the beginners.


P.S. :- I am basically used to python so there float or int, data type doesn't matter, so I generally thought if taking data input as int from the user which is wrong.
Thanks .❤❤

KoushikDas
Автор

Codewithharry is the best YouTube channel among all the YouTube channel. The way of teaching is very intuitive and understandable.

learncode
Автор

No words to say I m literally doing all programs without any doubts he is growing up all students lots of love to you Harry ❤️🧿✌🏻

Devolzgaming
Автор

9:13 I did the same using different method, took a bool value and then checked it.
Anyways, directly putting the condition in the print statement is also not bad.

My answer:-
System.out.println("Enter an integer:");
boolean b= S.hasNextInt();
System.out.println(b);

Thanks a lot, Harry.

KoushikDas
Автор

Thanks Harry,
Q.4
Ans :

sout sc = new Scanne(System.in);
float a = sc.nextFloat();

float mile = (a)*0.621371f;

sout ("Value in mile is");

sout(mile):
}

OnlyRupesh
Автор

8:26 OMG F . I had done this one as Km to m day before yesterday while practice. Going to try now. THIS IS WHY QUESTION READING SHOULD BE DONE THOROUGHLY. Sorry to myself as well as to Harry for not reading the question correctly, although I have applied the same concept there which is to be done. Going to change it now. Will come and share the answer.

KoushikDas
Автор

My school's computer teacher- Children now we are going to learn java.
Me - How will i learn java now as my sir teaches only the theory part in the classes and gives practicals in exam..😢😢
Harry sir - Full java tutorial for beginners.
Me - 😍😍😍😍😎 Now i can learn java very easily.

casseylimbo
Автор

System.out.println("Enter km which you want to convert into miles");
Scanner sc = new Scanner(System.in);
float km1 = sc.nextFloat();
float aa = km1*0.621371f;
System.out.println(aa);

AbhishekKumar-rizf
Автор

8:29 - Question 4
Here is the code,

import java.util.Scanner;
public class Length
{
public static void main (String[ ] args)
{
Scanner k = new Scanner (System.in);
System.out.print("Enter Length in Kilometers = ");
double kilometers = k.nextDouble();
double miles = kilometers/1.609;
System.out.println("Length in miles = "+miles+" mi");
}
}

himankjeshwar
Автор

2:20 But the same can be done by taking user input . You had did the same thing while telling us about data types but it was acceptable then as we had not learnt about the user input. But as we know we should take user input (user's choice of integers), and then run the program.

KoushikDas
Автор

time stamp : 8:24

import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
float kilo, miles;
Scanner sc = new Scanner(System.in);
System.out.println("enter the kilometers");
kilo=sc.nextFloat();
begins : ");
miles=kilo*0.62137119f;
System.out.print(miles);
}
}

Berozgaar