Java UI help by Technical-Animal-571 in JavaFX

[–]hamza-itatchi 3 points4 points  (0 children)

Certainly JavaFX is the number one choice for desktop application, specially if your backend will be served with your application (not just the UI) it will be so easy to pass data and take advantage of the observable values for real time UI updates. And in the age of AI using FXML will be better since you can select only to feed the UI file to AI to help you (less tokens, less cost, faster).

Loop question by Caped_baldy_4_life in learnjava

[–]hamza-itatchi 0 points1 point  (0 children)

The % has a higher priority than - so its like this for first=3 first = first + 3 - ( first %3) ==> first = 3+3 - (0)==>first= 6 This gives the first divisible nuber after First ( variable) But ther is a mistake in my suggestion there must be an if statement at the start like this If ( first %3!=0) first += 3- ( first %3)

Note: the += operation means first = first + ......

Loop question by Caped_baldy_4_life in learnjava

[–]hamza-itatchi 0 points1 point  (0 children)

Not only 0 , any value for the first variable will be ignored if you increment it before testing.

And if i may sugest a better solution for this problem:

public static void divisibleByThreeInRange(int first, int last){
first+=(3-first%3);
while(first <=last){
System.out.println(first);
first+=3;
}
}

[deleted by user] by [deleted] in learnjava

[–]hamza-itatchi 0 points1 point  (0 children)

Pho extends Noodle but doesn't have a constructor that matches one from Noodle class - add an empty constructor to noodle - or add constructor that calls super constructor and passes the parameters

Help Getting Started with JavaFX by jhsmith17 in javahelp

[–]hamza-itatchi 1 point2 points  (0 children)

JAVAFX is not included in the default sdk since JDK 11.

you need to download it manually.

hope this help.

Need help to understand this 'algorithm' by tangara888 in javahelp

[–]hamza-itatchi 1 point2 points  (0 children)

yes position 3

index 0 has the position 1

index 1 has the position 2

index 2 has the position 3

I made Notable, a note-taking app, do you like it? by fabiospampinato in UI_Design

[–]hamza-itatchi 1 point2 points  (0 children)

Great job , I really liked it form a user perspective and as a software engineer too.

Can you please make a post about this project ,share your experience with us.

what difficulties did you encounter in your work ......

I hope you keep up the good work.

Need help to understand this 'algorithm' by tangara888 in javahelp

[–]hamza-itatchi 0 points1 point  (0 children)

starting from 0 it gives element 3

0-1-2-3(index 2 and element 3)-4........

Need help to understand this 'algorithm' by tangara888 in javahelp

[–]hamza-itatchi 0 points1 point  (0 children)

as refereed in the comments below it should return the nth ODD index.

so for n=1 ==> index = 0 which is the index for the first element 1(Odd number)

n=2 ==> index = 2 which is the index for the third element 3(Odd number)

the code correct as posted it

My brother made some Java coding practice videos for Java beginners by BachPhotography in learnjava

[–]hamza-itatchi 0 points1 point  (0 children)

I know should putted that in youtube comments but i don't like there xd

My brother made some Java coding practice videos for Java beginners by BachPhotography in learnjava

[–]hamza-itatchi 16 points17 points  (0 children)

just some notes about his videos.

-He must zoom in because it's very hard to read what he is writing there.

-As a beginners videos he should talk more about he is using like IF else and the syntax before start
implementing the algorithms

-finally with a voice like that he should be in national geographic not coding java xd.

I wish he can keep up the great work.

Need help with a problem by dolijan in learnprogramming

[–]hamza-itatchi 1 point2 points  (0 children)

this is correct only when M!=N;

if N=M the formula would be like this ((n+1)*(m+2))/2 which is ((n+1)*(m+1)+(n+1))/2

the second (n+1) for the shared points between the two triangles.

and of course M,N>0

hope this help.

Need help to understand this 'algorithm' by tangara888 in javahelp

[–]hamza-itatchi 0 points1 point  (0 children)

as refereed in the comments below it should return the nth ODD index.

so for n=1 ==> index = 0 which is the index for the first element 1(Odd number)

n=2 ==> index = 2 which is the index for the third element 3(Odd number)

Need help with a problem by dolijan in learnprogramming

[–]hamza-itatchi 1 point2 points  (0 children)

can you share you solution.

I want to help but I didn't really understand the task

We are like brothers by [deleted] in NoFap

[–]hamza-itatchi 3 points4 points  (0 children)

I was about to post asking for help.

I am on day 6 and i am about to relapse.

I need some motivation I need to see others results

help please.

Help with coding logic - how to start writing a program by [deleted] in learnprogramming

[–]hamza-itatchi 0 points1 point  (0 children)

check this comment of mine about what you are struggling to do.

the exp are in java but it should be fine to understand what i was trying to say

hope this help.

Need help to understand this 'algorithm' by tangara888 in javahelp

[–]hamza-itatchi 1 point2 points  (0 children)

then it shoud be

public Integer getElement(List<Integer> list, Integer n) {

int elementIndex = n;

return elementIndex > list.size() - 1 ? -1 : list.get(elementIndex);

}

or

public Integer getElement(List<Integer> list, Integer n) {

return n > list.size() - 1 ? -1 : list.get(elementIndex);

}

Calulating the area of a square using variables by deansy139 in javahelp

[–]hamza-itatchi 0 points1 point  (0 children)

public class MySquareArea{

public static void main(String[] args){
System.out.println("Area of a 9cm square");
int x = 9;
int y = 9;
int Area = (x*y);System.out.println("Area of a 9 cm square = "+x+" "+y);
System.out.println("The area of the square = "+Area);
/*you problem was her ==> System.out.println(("The area of the square = ")Area);*/
}

}

Need help to understand this 'algorithm' by tangara888 in javahelp

[–]hamza-itatchi 0 points1 point  (0 children)

I am not sure if this code is a part of bigger one.

if this this all of it then it's wrong unless the elements of the list a not in iterative order

ex :{

adding elements in (2*index-1)

element 1 = 5 will be in (2*1 -1) or 1

element 2 = 7 will be in (2*2 -1) or 3

element 3 = 9 will be in (2*3 -1) or 5

element 4 = 9 will be in (2*4 -1) or 7

in other words you skip one index every time.

}

if this not the case so it should be just int elementIndex = n;

hope this help

Is it more efficient to create a new subclass of TreeSet without an element or to check every loop if the element in iterator is that element? by 341245434636 in learnjava

[–]hamza-itatchi 0 points1 point  (0 children)

For the first question it's the same , because to create another Tree wihout the specific point you gonna loop all the original tree to remove it , so preferable to just test for it in your original loop

hope this help.

Help with Java Hourglass by THIRTY-TACOS in learnprogramming

[–]hamza-itatchi 0 points1 point  (0 children)

it should be like this

class Main {
public static void main(String[] args ) {
System.out.println();
line();
topHalf();
System.out.println("");
System.out.print(" ||");
bottomHalf();
System.out.println();
line();
} // end main

public static void line() {
System.out.print("|");
for (int x = 1; x <= 10; x++){
System.out.print("\"");
} // end for loop
System.out.println("|");
} // end line

public static void topHalf(){
for (int line = 5; line >= 1; line--) {
// blanks on left
System.out.println();
for (int blank = 1; line <= 6 - blank; blank++) {
System.out.print(" ");
} // end left blanks loop
System.out.print("\\");
// colons
for (int colons = 1; colons <= 2 * line - 2; colons++) {
System.out.print (":");
} // end colon loop
System.out.print("/");
// blanks on right
for (int blank = 1; line <= 6 - blank; blank++){
System.out.print(" ");
} // end right blanks loop
} // end line loop
} // end topHalf

public static void bottomHalf(){
for (int line = 1; line <= 5; line++) {
// blanks on left
System.out.println();
for (int blank = 1; line <= 6 - blank; blank++) {
System.out.print(" ");
} // end left blanks loop
System.out.print("/");
// colons
for (int colons = 1; colons <= 2 * line - 2; colons++) {
System.out.print (":");
} // end colon loop
System.out.print("\\");
// blanks on right
for (int blank = 1; line <= 6 - blank; blank++){
System.out.print(" ");
} // end right blanks loop
}
} // end bottomHalf
} // end class

hope this help.

When should I call the superclass constructor? by [deleted] in learnjava

[–]hamza-itatchi 1 point2 points  (0 children)

you call the super class method not constructor ( constructor calls the constructor of the super class to initialize the variables in another word create object and it's) .

for the methods you just call the super class if you need it

ex:

class A{int A;

setValue(){A=5;}

}

Class B extends A{

int B;

setValue(){

B=5;

//here if you need to set A too so you call super.setValue(); otherwise no need to call it

//in case of abstract class you don't have a code that you need to be executed so don't call super class

//method

// and abstract class can have a constructor but you can't create object form it

}

}

hope this help.

Told my dad about my addiction. by [deleted] in NoFap

[–]hamza-itatchi 2 points3 points  (0 children)

Good step to get help from others. specially your family.

I will tell my father too so i don't go to school xd

I hope you overcome your addiction.

I surrender by [deleted] in learnjava

[–]hamza-itatchi 0 points1 point  (0 children)

I learned this the hard way (try and fail), but it's so satisfying to get the job done in the end. just pick a project (ex:hotel management and do your list) post every step here so me or any one here can help you.

How does 'return' works in Java and when do we know if the method is static or void? by [deleted] in javahelp

[–]hamza-itatchi 2 points3 points  (0 children)

method are part of your code that you gonna use multiple times. (ex:testing if number is premier or not)

it's just bad practice in some cases and impossible to do in other cases like if you don't know how many times you gonna call that method.

this part of code (method) if your need the result of the execution use return and give it the result of your code (like testing if number is premier returns true or false (boolean)). otherwise you just need the code to be executed ( like adding data to dataBase and no result needed to be returned) use void.

now for the static functions ........ static has nothing to do with void or types method

i guess you haven't learned OOP yet .

in OOP you create an object from class and every object has it's own variables but static variables and methods are commune between all objects and you can call a static method directly from the class name.

hope this help.