Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 199
  • Last Modified:

Initialization of data field

Hi! all !!

I have this code below

private static final int NumberOfstudents = 20;

How do I Initialize the data filed so that NumberOfstudents is equal to 5 and is no longer a constant.

Thanks in Advance
0
ZURINET
Asked:
ZURINET
  • 2
1 Solution
 
CEHJCommented:
You need to remove final

private static final int NumberOfstudents = 5;
0
 
ZURINETAuthor Commented:
Hi CEHJ

it should be something like this ?

private static int NumberOfstudents = 5;

0
 
CEHJCommented:
:-) Yep
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now