Jump to content

Tiemen

Members
  • Content Count

    6
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Tiemen

  • Rank
    Newbie
  1. Thank you for taking the time to explain. The Method overload is not completely clear, but I have a feeling I'll get it later when I just do the rest of the tutorial and exercises.
  2. This code below clarifies some part of my confusion in the first part of my question. But the second and 3th question remains. public class MyClass { public static void main(String[] args) { // Code here CANNOT use x { // This is a block // Code here CANNOT use x int x = 100; // Code here CAN use x System.out.println(x); } // The block ends here // Code here CANNOT use x } }
  3. So in the example below they want to give a example that multiple methods can have the same name with different parameters: I have a few questions: I thought variables had unique names, how does it knows we talk about the same x + y. I assume the variables are only defined within the method then, right? And not within the whole public class MyClass Second: Why does the double return the value 10.5599999999999 instead of 10.56 If I edit 6.26 to 6.27 it will return 10.57 public class MyClass { static int plusMethodInt(int x, int y) {
  4. Hi, I am starting to learm Java(first language). I am having trouble starting up. I try to run my first line of code. But it gives an error. I know the existense of command Prompt but I don't know how to use it. Can somone help me out? Thanks
×
×
  • Create New...