[ad_1]
Code is Here:
Best Java Book :
In this part of the Java Video Tutorial I cover most every method available for manipulating Strings and StringBuilders.
[ad_1]
Code is Here:
Best Java Book :
In this part of the Java Video Tutorial I cover most every method available for manipulating Strings and StringBuilders.
by
Tags:
very nice tutorial derek. But you didn't showed the reverse function in strings. please show how to use reverse function in strings…thnks.
Instead of saying… String longString = Long.toString(bigByte); You can say… String longString = bigByte + "";Hope that helps someone.
I wish you were my programming teacher at college :)i
what is the difference between size and length?
why do i have to type in Array.toString() to be able to print out the array? why not just System.out.println(letterArray);?
i fucking love your tutorials
Was allured by a 3 minutes video made by an Indian guy but his accent brought me back here. Sorry Derek , last time
9:45 why do you need to print it toString? For a nice looking?
hello Derek,
great videos. I'm watching the whole series. You are the best teacher 😉
Derek, I'm also have an small problem. I am newbie in programing and i see your Eclipse is displaying an explanation how each methods you type into the code work (yellow window next to the window that pops out when you click ctrl +space).
I guess for a newbie like me is really useful option. I can;t find such option in my eclipse. Can You tell me how to turn it on?
Oh my goodness I made a accidental discovery.. There are short cuts typing "sysout" and pressing "CTRL + SPACE" gives you System.out.println() I gotta learn some of these these are so good 🙂
Hello Derek, I was wondering what age do you think is best to learn programming, and when did you start learning?
Hi, Thanks for Wonderful tutorial
Sir do you have any tutorial for Springs ?
Derek you said that if the letters come before the moreLetters in the compareTo method, it'll print a negative number, but why? letters IS before moreLetters..
EDIT: Whenever I do StringBuilder randSB = new StringBuilder("Defining stuff");
it tells me "the constructor StringBuilder is undefined"
Hi Derek
Your tutorials are simply phenomenal. Thank you very much for these tutorials. How these videos only have about 54000 views i don't know. I guess not enough people are learning java 😉
Dear Sir,
Does java put anything at the end of the String like in C/C++ we have Null Character( ) ??
Sir Please Reply .
Thanks in advance!
thanks alot. really helpful videos.
"A random value" literally LMAO! I hope you realised the joke when you said it Derek.
Strings create a new place in memory when you change it's value, instead of overwriting. Is this just how Java works or do strings in other language also work this way?
Hi Derek,
what is the difference between creating a String with: String myString = new String("Hello world!"); AND String myString = "Hello world!";
Thanks in advance!
append( ), reverse( ), subsequence( ), are exclusively for stringBuilder
remaining methods are common for both string and stringBuilder
Am I right?
P.S: this is one of important concepts that we may expect questions in 1Z0-803 , oracle java certification. Please clarify 🙂
thank you so much 🙂 using what i learned from your awesome tutorials i've wrote a rock, paper, scissors program it's the biggest program i wrote in my life. thanks again Derek 🙂
here's the code.
import java.util.Scanner;
// I don't know what's this import for.
import javax.naming.spi.DirStateFactory.Result;
public class TheGame {
static Scanner userInput = new Scanner(System.in);
static String userAnswer;
static String ComputerAnswer;
static String compareResult;
public static void main(String[] args) {
System.out.println("rock, paper or scissors?");
userAnswer = userInput.nextLine();
System.out.println(computerAnswer());
System.out.println(compare(ComputerAnswer, userAnswer));
}
public static String computerAnswer()
{
int randomNum = (int) (Math.random() * 3);
//String result;
if (randomNum == 0)
{
ComputerAnswer = "rock";
}
else if (randomNum == 1)
{
ComputerAnswer = "paper";
}
else
{
ComputerAnswer = "scissors";
}
return ComputerAnswer;
}
public static String compare(String ComputerAnswer, String userAnswer)
{
if (ComputerAnswer.equals(userAnswer))
{
compareResult = "it's a Tie";
}
else if (ComputerAnswer.equals("rock"))
{
switch (userAnswer)
{
case "paper":
compareResult = "paper beats rock";
break;
case "scissors":
compareResult = "rock beats scissors";
break;
}
}
else if(ComputerAnswer.equals("paper"))
{
switch (userAnswer)
{
case "rock":
compareResult = "paper beats rock";
break;
case "scissors":
compareResult = "scissors beats paper";
break;
}
}
else if (ComputerAnswer.equals("scissors"))
{
switch (userAnswer)
{
case "rock":
compareResult = "rock beats scissors";
break;
case "paper":
compareResult = "scissors beats paper";
break;
}
}
return compareResult;
}
}
hi Derek just wanted to say your my favorite youtuber you explain everything very well and in a very direct way, its great you have videos over object oriented design which is the next course im taking, i was wondering if you having any DataStructure tutorials? thanks again Derek 😀
Hey Derek! I'm 13 and I'm currently very interested in learning how to write Java. One of my goals is to create a action RPG style game. But I get confused pretty easily with allot of the code. So is there anyway you recommend to make this a bit more understandable? Also, do I have to watch all 95 videos to completely understand or would you recommend select topics? Thanks!
whats the difference between using a conditional operator like == and .equals when comparing strings?
Derek, would you still say that the link for the best Java book in your description still holds? For example vs a book like Building Java programs by Reges and Stepp? I'm really considering getting the book in your description. Thanks! (Btw I'm a college freshman looking to major in math & CS)
Thanks <3
Really great tutorials thank you very much. Can you tell us more about how you got hired to work for apple?? Sounds interesting! Thank you Derek
hi +Derek Banas me again.. nice tutorial.. I will give you my credits on the exam. LOL
more clear than my professor's lecture! thank u
Will you ever play Minecraft with your subscribers? Great video by the way!
Hi Dereck.
Is there a way to automatically remove the line numbers from you code?
I love your videos they are great
I got one question
if you had two strings "james" and "____"
and you wanted to put say the "m" from james into the other string and replace just that one position how can you do that I've tried replace but it replaces them all because second string are all the same char.
Hey men your are the best……………Really………..
Your tutorials are excellent !!! Thank you.
YOU ARE THE BEST TEACHER EVER
I was wondering what would happen if I set the capacity of a string builder to be less than the length, then I tried to print it and it gave me the same string, shouldn't this throw an exception of invalid memory access?
Thank you 🙂 Im very happy to help and always feel free to ask questions.
YOU ARE THE BRO.. YOU REALLY HELPING ME WITH MY JAVA COURSE… KEEP UP THE GOOD WORK… 🙂
They are called methods or functions if you prefer that better.
Thank you 🙂
Probably the best java tutorial ever, thanks a lot 🙂
In what number?
Leave a Reply