r/learnjava • • Dec 27 '19

In 2020 java again going to change

1 Upvotes

r/learnjava • • Dec 21 '20

I'm new to Play Framework. I just started learning looking at my mentor's code. When I try to create a JsonNode, the request(). shows an error. Please help me. I know I have not created a method as request. But that is an inbuilt thing right? Help me plsss.

1 Upvotes

r/learnjava • • Sep 23 '16

What does it mean when you use the single quotation for assigning values?

1 Upvotes

For example, double w='a'+5. Is 'a' referring to character a?


r/learnjava • • Oct 30 '17

https://readlearncode.com/java-ee/eclipse-microprofile-5-things-you-need-to-know/

1 Upvotes

The MicroProfile specifies a collection of Java EE APIs and technologies which together form a core baseline microservice that aims to deliver application portability across multiple runtimes. In this article, you will discover the 5 most important things you need to know about this exciting new initiative.


r/learnjava • • Dec 22 '15

Could someone explain to me what camelCase is?

1 Upvotes

I am not entirly sure on what camelCase is. I am using mooc.cs.helenski and it just tells me that it is used to replace special characters. Is it just another variable or does it have another function?


r/learnjava • • Jan 25 '21

Can someone explain what is this hashmap and how to use it? With sime examle for dummies.

1 Upvotes

Thank you!


r/learnjava • • Feb 06 '21

Need help with Maps Api

1 Upvotes

Hello! I am trying to clone uber as a web app. In this, I want to mark nearby cabs on the map. I am not able to figure how to do this. And I am new to using APIs too. Can someone please help me.


r/learnjava • • Mar 01 '24

Dsa

1 Upvotes

I want to start preparing for my interview Iam a 1.5yrs experience in SDE but I don't know about Clear Knowledge about Data structures and algorithms I cannot solve problems in Interview Can anyone help me with that to Start preparing for a interview Coding rounds 😞 Thanks you


r/learnjava • • Mar 14 '24

What are some good coding apps that use Java for a beginner?

1 Upvotes

I want to start learning Java but don't know where to start.


r/learnjava • • Feb 27 '24

Getting Started with Generative AI using Java, LangChain4j, OpenAI and Ollama

1 Upvotes

In this article, we will explore the following:

  • A brief introduction to Generative AI?

  • How to interact with Open AI APIs using Java?

  • How to use LangChain4j to interact with OpenAI?

  • How to run a LLM model locally using Ollama?

  • Working with Ollama using LangChain4j and Testcontainers.

https://www.sivalabs.in/getting-started-with-generative-ai-using-java-langchain4j-openai-ollama/


r/learnjava • • Feb 15 '20

How do I make my java program work on other computers?

1 Upvotes

I'm working on my final project for my java class, and I have it on github. It's not done but i wanted to see if it would work on my brother's computer. I downloaded it from github as a zip file (and had to change my git ignore file to include the /dist folder in the commit; why is that omitted by default?)

then accesed the program.jar on my brother's pc in the zip file and it opened the program, but it didn't work right: anything that had to do with the database (sqlite) it just wouldn't work.

Obviously I'm probably "deploying" this application wrong, but I was just winging it to see what happens.

Why does this not work?

and how do I properly deploy a program so others can use it?

And why id /dist and /build files by default ignored when uploading to github?


r/learnjava • • Sep 05 '18

List of JVM options

1 Upvotes

This website shows a list of JVM options:

https://chriswhocodes.com/hotspot_options_jdk11.html


r/learnjava • • May 03 '18

[Discussion] My OOP Class was a fiasco

0 Upvotes

Title.

I honestly have no idea what happened this semester. I failed two classes both that are part of my career.

From my point of view there was a lot of distractions such as a new girl that I dated for one month and personal issues. I think I have depression but I deny it.

Anyways, I tried to follow the Helsinki Program but the pace of the class was way faster than the MOOC so I couldn't catch up.

I have three months of summer break that I will dedicate to learn what I didn't learned during the semester being OOP and Data Base.

MOOC is more than enough to learn from the basic to GUI to making a program that represents the Hanoi Towers?

I hope you can send me more advice to be "expert" on Java specially in OOP.

Thank You and Best regards

P.D. I almost cried after seeing the potential Software Engineering has and I'm not taking full advantage of it. I could help my father with his business but I feel like a total failure and even worst when my father says he's proud of me.

I know failure is part of someone's life and we MUST learn from our mistakes and that is why for this summer break I'm looking for advice. I might also go to the company of my uncle that develops software for companies, I still don't know the details of what programming language they use.


r/learnjava • • Mar 12 '19

Game running slow?

1 Upvotes

So I've got a pretty simple 2d game going and it's running like max 70 fps, usually around 40. My PC can definitely do better. Where should I even start looking to fix this?


r/learnjava • • Dec 31 '21

Convert JavaScript function to Java

1 Upvotes

Hello, I am following a YouTube video on dynamic programming. So the guy solve a problem on number of route available in a given grid that requires you to go right or down. He did the solution in JavaScript, I am having problem to replicate it in Java. This is the JavaScript function:

const gridtravel = (m, n, memo = {} => {
 const key = m + ',' + n;
 if (key in memo) return memo[key];
 if(m === 1 && n === 1) return 1;
 if(m === 0 || n === 0) return 0;
 memo[key] = gridtravel(m - 1, n, memo) + gridtravel(m, n - 1, memo);
  return memo[key];
 }

This is my trial in Java;

Map<String, Integer> memo = new Map<>();
 String key = m + ',' + n;
 if (memo.contains(key)) return memo.get(key);
 if(m == 1 && n == 1) return 1;
 if(m == 0 || n == 0) return 0;
 memo.put(key, gridtravel(m - 1, n) + gridtravel(m, n - 1));
  return memo.get(key);
}

I don't know how to replicate with the memo object use in JavaScript. The function is suppose to have two parameter of row and column. This approach is trying to get an optimized solution


r/learnjava • • Sep 13 '17

mooc- not a good learning way

0 Upvotes

So I've been trying to use http://mooc.cs.helsinki.fi to learn java, a year or so ago I was looking into Java as well, but went to networking, so I'm back to Java and everyone praised this site, but I honestly look at it and it is garbage. How is anyone learning anything with it? Am I missing some video lessons or explanations?

As an example: I'm doing the adder.java project and it asks:

Create a program that asks the user for two integers and then prints their sum.

Type a number: 6 Type another number: 2

Sum of the numbers: 8

I have no idea how to do any of this, the steps above do not compile at all.

Did I literary miss half of this course?


r/learnjava • • Mar 09 '14

How can I check if a string variable DOESN'T equal to something?

0 Upvotes

Hi!

I am trying to use an if-else if statement, but I am having some problems. I understand that for comparing string contents you use:

if (variable.equals("computer")) {
    do stuff
}

But basically, what I am trying to do is the following:

if (variable.equals("computer")) {
    do stuff
} else if (variable.doesntEqual("computer")) {
    do other stuff
} else if (variable doesntEqual("computer")) {
     do more different stuff
}

I am basically trying to check twice (maybe even 3 times) if the variable is indeed what the System has recorded, and each "else if" asks the user to insert it again. If by the 2nd or 3rd time (still debating) it isn't right, the program ends. If it happens to be right the 2nd or 3rd time, it will then move on to the rest of the code.

I've got the breaking in and out of loops figured (took some work, but in the end I managed to do it :D) only that part is the one that I can't quite accomplish. May be something really simple that I am simply overlooking!

Thanks in advance :)


r/learnjava • • Dec 23 '23

Is using the help of Bard/ChatGpt for designing my SPA cheating?

1 Upvotes

Hey everyone,

I'm building a small project for me and my friends to use and I'm designing the UML right now.
I have a good grasp of the most basic classes and components but now I'm thinking of using Abstraction.

I understand abstraction but right now I can't imagine how to use it in my app. Does that mean I do not understand it properly?
Should I engage in a discussion with an LLM to fill out my knowledge gaps or should I better re-read the Abstraction section of BlueJ?

The LLMs tend to just spill out the solution and taking away my learning experience.
How do you formulate your prompts to get good results?


r/learnjava • • Nov 21 '22

IDE

0 Upvotes

Intellij or eclipse for java?


r/learnjava • • Jun 10 '24

Path of Java After Oops for Internship

1 Upvotes

I am first year Indian BTech Student & my second semester is going on, and simultaneously I am learning Java by a course by Abdul bari sir, till now I have completed OOPS. My plan is too learn till multi threading, what should I do after that, for internship!!?


r/learnjava • • Dec 09 '24

Can someone explain how it works?

0 Upvotes

I wrote THIS in java without any help just my knowledge i need to make the player start over if he said yes and stop when say no and i needed to give a warn when the player provide wrong info like Potatos instead of yes or no. THE PROBLEM IS i don't even know how it works. Like really i tried to make it and i managed to.... but I don't know how it works so can someone explain how it works(not the whole code just the warning part)

Edit: As i said,  it's poorly written and thanks for every person told me that cuz now i understand the code and i understand why i should not use nested if statements or loops and i understand why it's important to write a clean code and save memory and that's an improved version i made: The Code


r/learnjava • • Nov 16 '15

help with switching from while to for and adding array

1 Upvotes

Ok, so this is my original code that takes the input and uses it to make shipping labels. I used 'while' loops to do it and now I'm supposed to switch to a 'for' and use an array for all the user input instead of individual Strings.

public static void main(String[] args) { // declare variables String title; String firstName; String lastName; String streetAddress; String city; String state; String zip; String numBoxesInput; String enterAnother = "Y"; int numBoxes; int count;

    // priming read of mail order input from the user
    title = JOptionPane.showInputDialog("Enter title (Mr., Ms., Dr., etc.): ");
    firstName = JOptionPane.showInputDialog("Enter first name: ");
    lastName = JOptionPane.showInputDialog("Enter lastname: ");
    streetAddress = JOptionPane.showInputDialog("Enter street address: ");
    city = JOptionPane.showInputDialog("Enter city: ");
    state = JOptionPane.showInputDialog("Enter state (IL, MO, etc.): ");
    zip = JOptionPane.showInputDialog("Enter zip (e.g., 62025): ");

    numBoxesInput = JOptionPane.showInputDialog("Enter number of boxes in the order:");
    numBoxes = Integer.parseInt(numBoxesInput);

    //while

     while(enterAnother.compareToIgnoreCase("N") != 0)
     {
     	count = 1;
     	while(count <= numBoxes)
     	{
     					System.out.println(title + " " + firstName + " " + lastName);
		                System.out.println(streetAddress);
		                System.out.println(city + ", " + state + " " + zip);
		                System.out.println("Box " + count++ + " of " + numBoxes);
		                count = count++;
		                System.out.println();
		}

		// ask the user if finished entering mail orders
        enterAnother = JOptionPane.showInputDialog("Do you want to produce more labels? Y or N");
		//When prompted, if the user inputs Y or y, this if will complete the steps to make more labels.
			if(enterAnother.equalsIgnoreCase("Y"))
			{

			title = JOptionPane.showInputDialog("Enter title (Mr., Ms., Dr., etc.): ");
			firstName = JOptionPane.showInputDialog("Enter first name: ");
			lastName = JOptionPane.showInputDialog("Enter lastname: ");
			streetAddress = JOptionPane.showInputDialog("Enter street address: ");
			city = JOptionPane.showInputDialog("Enter city: ");
			state = JOptionPane.showInputDialog("Enter state (IL, MO, etc.): ");
    		zip = JOptionPane.showInputDialog("Enter zip (e.g., 62025): ");
			numBoxesInput = JOptionPane.showInputDialog("Enter number of boxes in the order:");
			numBoxes = Integer.parseInt(numBoxesInput);
			count = 1;

			}


	}

	System.exit(0);
}

}

and this is where I am in my new code String[] labelInfo = new String[8]; String enterAnother = "Y"; int numBoxes; int count;

    // priming read of mail order input from the user
    labelInfo[0] = JOptionPane.showInputDialog("Enter title (Mr, Ms, Dr, etc.): ");
    labelInfo[1] = JOptionPane.showInputDialog("Enter first name: ");
    labelInfo[2] = JOptionPane.showInputDialog("Enter last name: ");
    labelInfo[3] = JOptionPane.showInputDialog("Enter street address: ");
    labelInfo[4] = JOptionPane.showInputDialog("Enter city: ");
    labelInfo[5] = JOptionPane.showInputDialog("Enter state (IL, MO, etc.): ");
    labelInfo[6] = JOptionPane.showInputDialog("Enter zip (e.g., 62025): ");

    labelInfo[7] = JOptionPane.showInputDialog("Enter number of boxes in the order:");
    numBoxes = Integer.parseInt(labelInfo[7]);

    // Outer while

     while(enterAnother.compareToIgnoreCase("N") != 0)
     {
     	count = 1;
     	//inner while that outputs user input on display while loop is running
     		while(count<= numBoxes)
     		{
     			System.out.println(labelInfo[0] + " " + labelInfo[1] + " " + labelInfo[2]);
		  		System.out.println(labelInfo[3]);
		    	System.out.println(labelInfo[4] + ", " + labelInfo[5] + " " + labelInfo[6]);
		    	System.out.println("Box " + count++ + " of " + numBoxes);
		    	count = count++;
		    	System.out.println();
			}

		//Asks the user if finished entering mail orders
         enterAnother = JOptionPane.showInputDialog("Would you like to make more labels? Y or N");
		//When prompted, if the user inputs Y or y, this if statement will complete the steps to make more labels. If not, the control loop will exit the program.
			if(enterAnother.equalsIgnoreCase("Y"))
			{

				labelInfo[0] = JOptionPane.showInputDialog("Enter title (Mr, Ms, Dr, etc.): ");
				labelInfo[1] = JOptionPane.showInputDialog("Enter first name: ");
				labelInfo[2] = JOptionPane.showInputDialog("Enter last name: ");
				labelInfo[3] = JOptionPane.showInputDialog("Enter street address: ");
				labelInfo[4] = JOptionPane.showInputDialog("Enter city: ");
				labelInfo[5] = JOptionPane.showInputDialog("Enter state (IL, MO, etc.): ");
    			labelInfo[6] = JOptionPane.showInputDialog("Enter zip (e.g., 62025): ");
				labelInfo[7] = JOptionPane.showInputDialog("Enter number of boxes in the order:");
				numBoxes = Integer.parseInt(labelInfo[7]);

			}


	}

	System.exit(0);
}

}


r/learnjava • • May 06 '14

Web Application Folder Structure for Spring MVC Web Projects

Thumbnail
vitalflux.com
0 Upvotes

r/learnjava • • Oct 08 '17

Programing Assignment Help

1 Upvotes

My professor doesn't teach us since she expects us to know how to do everything although I'm taking an intro class in java. Anyway, any help is appreciated. This is the assignment itself https://imgur.com/a/iT0Wq I have some ideas on how to do this problem but no way of actually knowing how to do them because of my professor. This is a link to the code I wrote on pastebin https://pastebin.com/GjUiZnnb. I tried to make one array with the entire input but the space is considered another input instead of a white space. There's a lot that needs to be done and I don't really know where to even start. Any help is super appreciated, thanks.