r/JavaProgramming • u/DingoDistinct7341 • 14d ago
看看这段聊天
r/JavaProgramming • u/TelevisionMajor6461 • 15d ago
Let's challenge each other with tricky Java code snippets! Guess the output, explain the logic, and learn something new every day. From basics to advanced Java concepts. 🚀
r/JavaProgramming • u/SniperxAMW_ • 15d ago
import java.util.*;
class Tic_Tac//Game for Shashwat, By Shashwat
{
public static void main(String args[])//Dont want to add but added as prescribesd by sir.
{
Scanner sc=new Scanner(System.in);
int k=0,j=0,r,ch=0,c,i,c1=0,c2=0;
char p1,p2;
System.out.println("\t TIC-TAC-TOE GAME");
char a[][]=new char[3][3];
System.out.println("Enter the choice of player 1");
System.out.println("1.X");
System.out.println("2.O");
int q=sc.nextInt();
while(q>2||q<1)
{
System.out.println("Invalid choice .Enter again(1 or 2)");
q=sc.nextInt();
}
if(q==1)
{
p1='X';
p2='O';
}
else
{
p2='X';
p1='O';
}
System.out.println(" 0 1 2");
for( i=0;i<3;i++)
{
for( j=0;j<3;j++)
{ if(j==0)
System.out.print(i+" ");
System.out.print(a[i][j]+" ");
if(j<2)
System.out.print("|");
}
System.out.println();
if(i<2)
System.out.println(" --------");
}
for(int I=0;I<9;I++)
{
System.out.println("Enter position");
while(true)// Thought useless but it is necessary
{
r=sc.nextInt();
c=sc.nextInt();
if(r>2||c>2||r<0||c<0)
{
System.out.println("Invalid position .Enter again");
}
else if(a[r][c]!='\u0000')//\u0000 learnt during making of program
{
System.out.println("Invalid position .Enter again");
}
else
break;
}
if(ch%2==0)
a[r][c]=p1;
else
a[r][c]=p2;
ch++;
System.out.println(" 0 1 2");
for( i=0;i<3;i++)
{
for( j=0;j<3;j++)
{ if(j==0)
System.out.print(i+" ");
System.out.print(a[i][j]+" ");
if(j<2)
System.out.print("|");
}
System.out.println();
if(i<2)
System.out.println(" --------");
}
if(I>=4)
{
for( i=0;i<3;i++)
{ c1=0;c2=0;
for( j=0;j<3;j++)
{
if(a[i][j]==p1)
{
c1++;
}
if(a[i][j]==p2)
c2++;
}
if(c1==3)
{
System.out.println(p1+" is WINNER !");
return;
}
if(c2==3)
{
System.out.println(p2+" is WINNER !");
return;
}
}
for( i=0;i<3;i++)
{ c1=0;c2=0;
for( j=0;j<3;j++)
{
if(a[j][i]==p1)
{
c1++;
}
if(a[j][i]==p2)
c2++;
}
if(c1==3)
{
System.out.println(p1+" is WINNER !");
return;
}
if(c2==3)
{
System.out.println(p2+" is WINNER !");
return;
}
}
c1=0;c2=0;
for(i=0,j=0;i<3&&j<3;i++,j++)
{
if(a[i][j]==p1)
{
c1++;
}
if(a[i][j]==p2)
c2++;
if(c1==3)
{
System.out.println(p1+" is WINNER !");
return;
}
if(c2==3)
{
System.out.println(p2+" is WINNER !");
return;
}
}
c1=0;c2=0;
for(i=0,j=2;j>-1&&i<3;j--,i++)
{
if(a[i][j]==p1)
{
c1++;
}
if(a[i][j]==p2)
c2++;
if(c1==3)
{
System.out.println(p1+" is WINNER !");
return;
}
if(c2==3)
{
System.out.println(p2+" is WINNER !");
return;
}
}
}
}
System.out.println(" The game is draw");
}
}
r/JavaProgramming • u/SniperxAMW_ • 15d ago
import java.util.*;
class Cir_matrix
{
public static void main()
{
Scanner in=new Scanner(System.in);
int n,r,c,x,y,i,j,z=1,m;
System.out.println("Enter no. of index");
n=in.nextInt();
int a[][]=new int[n][n];
r=n-1;c=n-1;//last
int R=0,C=0;//first
m=n-2;
for(j=1;j<=m;j++)
{
for(i=C;i<c+1;i++)
{
a[C][i]=z;
z++;
}
R++;
for(i=R;i<r+1;i++)
{
a[i][r]=z;
z++;
}
for(i=c-1;i>=C;i--)
{
a[c][i]=z;
z++;
}
R--;
for(i=r-1;i>R;i--)
{
a[i][R]=z;
z++;
}
R++;C++;r--;c--;
}
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{ if(a[i][j]<10)
System.out.print(a[i][j]+" ");
else
System.out.print(a[i][j]+" ");
}
System.out.println();
}
}
}
r/JavaProgramming • u/thearjunreddy • 16d ago
Focus on OOP, strings, collections, exception handling, interfaces, abstract classes, Java 8 features, basic multithreading, SQL, and coding problems. Be prepared to explain concepts with examples rather than memorizing definitions.
r/JavaProgramming • u/SniperxAMW_ • 15d ago
import java.util.*;
class Saddle
{
public static void main()
{
Scanner in =new Scanner(System.in);
System.out.println("Enter no. of index between 3 and 10");
int n=in.nextInt();
if(n<3||n>10)
return;//change to true while
int a[][]=new int[n][n];
System.out.println("Enter value in matrix");
int i,j,t,p,y=0,z=0,s=0,d,I;
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
a[i][j]=in.nextInt();
}
System.out.println("original matrix");
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
System.out.print(a[i][j]+" ");
System.out.println();
}
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
for(p=0;p<n;p++)
{
if(a[i][j]<=a[i][p])
{
y++;
}
}
for(p=0;p<n;p++)
{
if(a[i][j]>=a[p][j])
{
z++;
}
}
if(y==n&&z==n)
{
System.out.println("Saddle point at index "+i+" "+j);
}
y=0;
z=0;
}
}
j=n;t=0;
System.out.println("original matrix");
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
System.out.print(a[i][j]+" ");
System.out.println();
}
j=n-1;i=0;
for(I=1;I<=n;I++)
{
t=a[i][j];
while(t>0)//Harshad no
{
d=t%10;
s+=d;
t=t/10;
}
p=(n-1)-j;
if(s!=0)
{
if(a[i][j]%s==0)
a[i][p]=a[i][j];
}
i++;
j--;
s=0;
}
System.out.println("Moidified matrix");
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
System.out.print(a[i][j]+" ");
System.out.println();
}
}
}
r/JavaProgramming • u/frekost • 16d ago
r/JavaProgramming • u/surya_bonagiri • 17d ago
Yesterday, I attended a Java interview at Charles Schwab.
The interview was scheduled in two parts.
1. Coding/Assessment Round
In the first half, I was given a problem statement to build a simple Appointment Scheduler Java API.
The requirements were:
Appointments should not clash with each other.
Appointments should be booked correctly without conflicts.
The application should work for multiple customers at the same time.
The solution should handle concurrency without deadlocks.
The assessment was focused on building a simple Java API project around appointment scheduling.
Also, they offered a good and proper lunch in the cafeteria, which was a nice experience.
2. Interview Round
After completing the assessment, I was called for an interview round. They reviewed the assessment in the interview room itself and then asked me the following questions.
About myself
Tell me about yourself.
Why are you looking for a job change?
Production debugging
Suppose there is an issue in production, but the same issue cannot be reproduced in any of the lower environments. How would you start debugging it?
Suppose I want to change the production logging level on the fly from ERROR to DEBUG and then change it back to ERROR. How would you do that?
Microservices logging
Suppose there are three microservices communicating with each other. How would you implement logging across these services?
If there is a failure in Service 2, how would you identify where exactly the failure happened?
Trace ID / Span ID
How would you use a Trace ID and Span ID?
How would you use the Trace ID to identify where an issue occurred and which service failed?
Server restart / lost logs
Suppose a server restarted and all the error logs were lost. How would you investigate what happened?
Why do servers restart automatically?
Once completing this round.there is another round of DSA & HR.
Overall, the interview was focused heavily on Java, concurrency, production debugging, logging, microservices, and distributed tracing.
r/JavaProgramming • u/FrankCodeWriter • 16d ago
r/JavaProgramming • u/Feisty-Outside5055 • 17d ago
I am a fresher trying to get into IT. I started studying Java Spring Boot. I want to know if companies still hire for Java roles.
r/JavaProgramming • u/AgreeableAvocado7657 • 17d ago
Hi everyone,
I've been working on a modern Medicare Dashboard System using pure Java Swing, and I'd like to share my latest project with you.
The system includes three different dashboard designs:
Hospital Dashboard
Medical Dashboard
Dentist Dashboard
I focused on creating a clean, modern, and user-friendly interface using standard Java Swing components without any external UI frameworks.
The dashboards include navigation menus, statistics cards, data tables, charts, patient information, and custom UI components.
I also tried to give each dashboard its own look and feel while maintaining a consistent design across the entire system.
I've recorded a step-by-step tutorial showing the design process and sharing the source code.
Watch the Full Tutorial:
https://www.youtube.com/watch?v=C7PcMyNcrTs
I'd really appreciate your feedback. What do you think of the design? Which of the three dashboards do you like most?
I'm always interested in hearing suggestions from other Java developers.
r/JavaProgramming • u/Shot-Requirement7171 • 17d ago
r/JavaProgramming • u/Background_Cut2792 • 17d ago
r/JavaProgramming • u/fykup • 18d ago
I've been experimenting with ways to run Java applications more efficiently, particularly on smaller VPS instances.
So far I've tested Spring Boot optimizations, Javalin, GraalVM Native Image, different JDK versions, and persistence frameworks. I'm also working on an even leaner Java application stack.
My focus is practical Java: understanding memory usage, startup time, performance, and how to keep deployment simple.
For example, I think a small Java SaaS app can realistically run on a 1 GB VPS, including a database, depending on the workload.
I share these experiments in two Daily Dev squads: Java Experiments and Efficient Self-Hosting. I'm also happy to share interesting results here if people find them useful.
What would you like to see tested next? Any frameworks, libraries, configurations, or real-world deployment scenarios you're curious about?
r/JavaProgramming • u/javinpaul • 18d ago
r/JavaProgramming • u/LongCelebration4425 • 18d ago
r/JavaProgramming • u/javinpaul • 19d ago
r/JavaProgramming • u/Different-Memory6167 • 19d ago
r/JavaProgramming • u/Economy_Tie_5224 • 19d ago
r/JavaProgramming • u/Hopeful-Raspberry487 • 20d ago
r/JavaProgramming • u/Enough_Charge2845 • 20d ago
Pulled open requisitions from public job board endpoints across 72 tech companies to see what people are actually listing.
The interesting part is that practice words and concepts totally dwarf individual tech stacks. Scalability shows up in about 53 percent of postings, mentoring is in 47 percent, and distributed systems and system design sit right around 47 percent as well. Mentoring specifically surprised me because it's higher than Kubernetes at 31 percent, React at 21 percent, or TypeScript at 20 percent.
For languages, Python leads at 44.8 percent, followed by Java at 35.4 and Go at 31.1. Everything else drops off from there, with TypeScript, C++ and SQL sitting in the high teens. On the frontend side, React is in about one in five postings while Vue and Angular barely register around 3 percent. For cloud, AWS is at 41 percent and Kubernetes is at 30.
Sample skews heavily toward US tech companies. I threw the full dataset and raw CSVs up here if anyone wants to check the numbers or look at other roles like DevOps and security: https://resumefitting.com/ats-resume-keyword-study