Тёмный
A J
A J
A J
Подписаться
"Devote the rest of your life to making progress." - Epictetus
Java Number Guessing Game
11:00
6 лет назад
Random String Generator Java
14:14
6 лет назад
Комментарии
@AsraBegum-so3hz
@AsraBegum-so3hz Месяц назад
If I want to include print try again then what I want to do
@aryamangupta3919
@aryamangupta3919 4 месяца назад
It’s example of aggregation not composition , in composition container class cannot exist without contained . Pls stop sharing miss info
@user-sr2zt8ty4x
@user-sr2zt8ty4x 8 месяцев назад
you helped me out so much omg, like I never seen a video so good before I'm grateful for this vid thank you so much
@DancingKeanu
@DancingKeanu 8 месяцев назад
thanks bro helped alot,
@kiten9
@kiten9 8 месяцев назад
You're explanation is perfect
@janko-bm9lj
@janko-bm9lj 8 месяцев назад
Bro I love u so much u dont understand how simple u explained this compared to my teacher and the numerous videos i watched before
@Electrologia
@Electrologia 9 месяцев назад
Great video! thanks a lot!
@a.qaddomy3900
@a.qaddomy3900 9 месяцев назад
Bro I love u
@aryamangupta3919
@aryamangupta3919 4 месяца назад
Don’t love misinformed person
@B3Band
@B3Band 10 месяцев назад
SPEAK UP
@seydinamouhamedgueye4266
@seydinamouhamedgueye4266 11 месяцев назад
Great video, thanks for this explanation. But I think this explain more the polymorphisme than Composition.
@esthe9588
@esthe9588 Год назад
that really helped me alot. thank you
@stevenshrii
@stevenshrii Год назад
Oop
@stevenshrii
@stevenshrii Год назад
What is the difference in an instance, an object and pointer?
@rwtolplive4ever
@rwtolplive4ever Год назад
Hi, do you have a tutorial for writing java method with the following header that returns a pentagonal number: public static int pentagonal (int n). Then write a test program that uses this method to display the first 100 pentagonal numbers showing 10 numbers on each line, using 10 spaces for each number?
@dorukgencel3997
@dorukgencel3997 Год назад
Thanks mate, solved an issue I was having. Just didn't notice the problem, following correct steps made me realize how stupid the mistake was :)
@sol-mankim5049
@sol-mankim5049 Год назад
its a perfect example
@user-ec6ej4dp6t
@user-ec6ej4dp6t Год назад
This makes sense but does not solve what is expected of me with my project currently. Teacher wants me to have 3 words and then generate random output of the 3 words
@UniProgrammer
@UniProgrammer Год назад
Instead of the full alphabet, you could set the list of characters to be the three words. This can be done dynamically from user input or hard-coded prior to execution.
@bashardd9254
@bashardd9254 Год назад
great video! helped me Thanks!
@nikoteenie9641
@nikoteenie9641 Год назад
Loved this tutorial! So simple and made it so clear. I decided to also implement a randomized number for the secretNumber and when guessed correctly gave an output of how many guesses it took you to get to the correct one. Enjoy! :) import java.util.Scanner; //to take in user input import java.util.Random; //to create a random number public class GuessGame { public static void main(String[] args) { int secretNumber; // what the number is set to int userGuess; // the user input int guessCount = 0; // number of users guesses boolean correct = false; // set to false so that it's changed to true when guessed correctly Scanner keyboard = new Scanner(System.in); // so that we can use the user input //Creates the max and min number the object can randomly generate int maxNumber = 1000; int minNumber = 1; //Creates a random number object Random randomNumber = new Random(); //Attaches the random number object to secretNumber making it a short number secretNumber = minNumber + randomNumber.nextInt(maxNumber); //Loop through asking for numbers until the user guesses the secretNumber. // Create loop to move through the guesses while(!correct) { // while not false == true System.out.print("Guess the number that I am thinking: "); userGuess = keyboard.nextInt(); //takes input from the user if(userGuess == secretNumber) { // if guessed correctly correct = true; System.out.println("!!!YOU'RE A WINNER!!!"); System.out.println("It took you " +guessCount+ " guesses!");// includes number of wrong guesses } else if (userGuess < secretNumber){ System.out.println("GUESS HIGHER"); guessCount++; //counts wrong guesses } else if (userGuess > secretNumber) { System.out.println("GUESS LOWER"); guessCount++;//counts wrong guesses } } } }
@xy4611
@xy4611 Год назад
but how can we change acct1 name? will all objects named as acct1?
@ryan4thewin
@ryan4thewin 2 месяца назад
Im searching for this response everywhere on the internet. How do i create a new class object using user input??
@xy4611
@xy4611 Месяц назад
​@@ryan4thewin ok as i learned you dont you store them in arraylist, array, hashmap etc.
@mosamahlangu9164
@mosamahlangu9164 Год назад
Can you please help me return my array values in descending order.
@monojitchakraborty1259
@monojitchakraborty1259 Год назад
This is gold! all my doubts about inheritance and abstract class are solved after watching this.
@brunoaraujo5818
@brunoaraujo5818 Год назад
Salvou mt, vlw
@alp196
@alp196 Год назад
Thank you!!
@tonkata8624
@tonkata8624 Год назад
That helped me learn Composition a lot quicker! Thanks mate!
@QFGEE
@QFGEE Год назад
University of the People sent me here, and this is a far better explanation than the one they gave.
@syahrillstudy7906
@syahrillstudy7906 Год назад
Have tried it but there were an error " java: variable guess might not have been initialized " . What the solution to this problem?
@Muslim_YM.26
@Muslim_YM.26 Год назад
import java.util.Random; import java.util.Scanner; public class g { public static void main(String[] args) { Random random=new Random(); Scanner input=new Scanner(System.in); int Limit; int Guess; int rand; System.out.println("Enter The Limit of Guessing"); Limit=input.nextInt(); rand=random.nextInt(Limit); for (int i=0;i<=5;i++) { System.out.println("Enter The Number You Think Is Correct< 5Try Only >"); Guess=input.nextInt(); if (rand==Guess) { System.out.println("YOY ARE CORRECT!"); break; } else if (rand!=Guess) { System.out.println("SORRY TRY AGAIN"); } } } }
@lorencemanocasi8544
@lorencemanocasi8544 Год назад
Wow
@jaope9438
@jaope9438 Год назад
Thank u so much for this vid Now I can finish my lab knowing what to do now
@djestes1
@djestes1 Год назад
best java tutorials on youtube. thank you so much
@savisoccer7493
@savisoccer7493 Год назад
UNIP man thank you so much, thanks to you I got a 100% in my class 😎
@francistettey9114
@francistettey9114 Год назад
Please can you show me how to Implement date in java
@shephardstudio7617
@shephardstudio7617 Год назад
Good day Man. I really love your videos, just a quick question. Can a method be accessed from a subclass of an inherited class that is (This method should be different from the method of it's superclass)
@wongjuan344
@wongjuan344 2 года назад
you teach better then my cc prof
@DanielOliveira-kw5bl
@DanielOliveira-kw5bl 2 года назад
Thank you so much bro
@shinigamisecret
@shinigamisecret 2 года назад
ty dude
@thandarkhaing7619
@thandarkhaing7619 2 года назад
which app you use for java?
@karloliveira4724
@karloliveira4724 2 года назад
Nice, thanks
@joy-sm5sl
@joy-sm5sl 2 года назад
damn fwuffy can't make me focus
@xxvolcomxx56
@xxvolcomxx56 2 года назад
Why not using this keyword when setting the constructor?
@EleMentXBestCODGameplays111
@EleMentXBestCODGameplays111 2 года назад
Thank you ! great explanation
@dedz
@dedz 2 года назад
One question that I have is why to use abstract methods when we already know that we are going to need to make a method in the instance and probably already knows what the method should do? I mean, for me, it makes more sense to make a non-static method speak() inside the Pet abstract class and make it generic for all the subclasses (name and age for parameters so when you call the speak method you just need to pass the name and age as arguments), and if you want to change the speak method inside a subclass, you just override in that subclass.
@sebas.arocha
@sebas.arocha 2 года назад
Thank you so much! This helps me a lot with my programming class in college.
@51_ayushmagar72
@51_ayushmagar72 2 года назад
if u r writing this code in Notepad public class Overload { public void print(int num) { System.out.println("1st print method"); System.out.println("int: " + num); } public void print(double num) { System.out.println("2st print method"); System.out.println("double: " + num); } public void print(String text) { System.out.println("3st print method"); System.out.println("String: " + text); } public void print(int num1, int num2) { System.out.println("4st print method"); System.out.println("int: " + num1 + "int: " + num2); } public static void main(String[] args) { Overload object1 = new Overload(); object1.print (1); } } thank me later BTW thanks man for making it simple😁
@jibinjames5128
@jibinjames5128 2 года назад
Good One
@rymdie
@rymdie 2 года назад
Which theme do you use ? I like it.
@ibtisamali9636
@ibtisamali9636 Год назад
set your windows theme to dark ...
@ah.2169
@ah.2169 2 года назад
“Has-a” is for aggregation, not composition!
@esmeraldasaldana5441
@esmeraldasaldana5441 2 года назад
Thank you for the explanation. I was feeling overwhelmed but I now have a better understanding. This has really helped me complete the exercises for my intro to Java class. Much appreciated.
@mj4043
@mj4043 2 года назад
how can we enter the information by ourselves? (I mean , input)
@soulgure1441
@soulgure1441 2 года назад
Appreciate it friend, this helped me big time.