₦airaland Forum

Welcome, Guest: Register • Login • With Google • Trending • Recent • New

Stats: 3,345,530 members, 8,518,076 topics. Date: Friday, 13 November 2026 at 01:19 PM

Toggle theme

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

Nairaland Forum › Science/Technology › Programming › Java Codes For Beginners And Pros (relaxation Thread) (1345 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 Veterans • Guess The Number - Java Codes • Python �� Beginners And Experts • 2 • 3 • 4

What Is The Best Language For Embedded Systems? • To Create Individual Profile For New Users Or Not • Codefixbug - Software development company