₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,324,986 members, 8,419,835 topics. Date: Thursday, 04 June 2026 at 01:15 AM

Toggle theme

Java Codes For Beginners And Pros (relaxation Thread) - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingJava Codes For Beginners And Pros (relaxation Thread) (1314 Views)

1 Reply (Go Down)

Java Codes For Beginners And Pros (relaxation Thread) by SilverG33k(op):
To the java pros....

I'm not much of a java code writer but I know the basics so don't attack me

Yours Sincerely
Silver

.................

I just wrote the below code and I don't even know what's going to be the output.... Turn yourself to a compiler and tell us the output of the code

public int rand()
{
Integer random = {"1", "2", "3", "4", "5"};
Integer randomGetter = (int) Math.random() * 5;
Integer finalRandom = random[randomGetter];
Integer answer = finalRandom;
return answer;
}

//if my code has a logical error, I did it deliberately, it is my error, not yours (^_^)

my question iz..... What will be the output of the code above??
Re: Java Codes For Beginners And Pros (relaxation Thread) by Nobody: 12:02pm On Jun 02, 2017
I am a newbie in Java. ur code was not written
properly but the output are
5
10
15
20
25
Re: Java Codes For Beginners And Pros (relaxation Thread) by SilverG33k(op): 4:40pm On Jun 02, 2017
proxy20:
I am a newbie in Java. ur code was not written
properly but the output are
5
10
15
20
25
Oya write it properly
Re: Java Codes For Beginners And Pros (relaxation Thread) by rayyspark(m): 6:09pm On Jun 02, 2017
SilverG33k:
Oya write it properly
try 2 be polite
Re: Java Codes For Beginners And Pros (relaxation Thread) by SilverG33k(op): 8:34pm On Jun 02, 2017
rayyspark:
try 2 be polite
My apologies
Re: Java Codes For Beginners And Pros (relaxation Thread) by SilverG33k(op): 8:34pm On Jun 02, 2017
rayyspark:
try 2 be polite
My apologies
Re: Java Codes For Beginners And Pros (relaxation Thread) by ABCthingx: 5:34pm On Dec 17, 2019
Naso this thread take die cheesy shocked
1 Reply

Download 18 Python Programming Books For Beginners And VeteransGuess The Number - Java CodesPython �� Beginners And Experts234

I Want To Learn Programming Which Language Willl I Start WithOutlook Messages No Longer Open.I Am Actively Looking For A C++ Position In Lagos