php hit counter

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS201 Introduction to Programming GDB No.1 Solutions and Discussions Spring 2014
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support
#2
It's not a problem. However, it is generally accepted good design practice to limit the scope of every variable so that it's as wide as it needs to be - but no wider ;-)

This means that:
- you don't use a method local variable as the controlled variable of a for loop, if you can declare the controlled variable in the for loop heading.
- you don't use a class global variable (field) inside a method if you can instead use a local variable declared inside the method.
- you don't declare a field public if it can be protected, nor protected if it can be private.
- you don't declare a field static if it can be non-static.
- class level "final" values should be declared static.

In my experience as a Java programming teacher, most students have difficulties with the second option, and will tend to declare a lot of class global fields for variables should have been declared local.

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Messages In This Thread
CS201 Introduction to Programming GDB No.1 Solutions and Discussions Spring 2014 - by Vuhelper - 07-28-2014, 01:51 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  HRM628 VU Current GDB No. 1 Spring April 2012 Solution required Vuhelper 1 3,758 07-22-2020, 08:06 PM
Last Post: Johnnieaunders
  MGT501 Human Resource Management GDB No.1 Discussions and Solutions Fall 2014 Vuhelper 0 3,563 12-04-2014, 09:07 PM
Last Post: Vuhelper
  MGT211 Introduction To Business GDB No 1 Solution Ideas Fall 2014 Vuhelper 0 1,734 12-04-2014, 03:20 PM
Last Post: Vuhelper
  FIN711 Advanced Financial Accounting GDB No. 01 Fall 2014 Last Date 8th December Vuhelper 0 2,131 12-03-2014, 09:15 PM
Last Post: Vuhelper
  MGT101 Financial Accounting GDB Solution and Discussion December 2014 Vuhelper 0 2,916 12-03-2014, 09:05 PM
Last Post: Vuhelper
  MGT703 Strategic Management GDB No.1 Fall 2014 Solutions Ideas Vuhelper 0 1,909 12-03-2014, 08:45 PM
Last Post: Vuhelper
  MGT201 Financial Management GDB No. 01 Solution Fall 2014 Last date is 4th Dec 2014 Vuhelper 0 2,522 12-03-2014, 03:58 PM
Last Post: Vuhelper
  MGT520 International Business GDB No. 01 Solution and Discussion Fall 2014 viki 0 2,645 12-03-2014, 03:03 PM
Last Post: viki
  GDB No 1 MGT301 Principles of Marketing Solution and Discussion December Fall 2014 viki 0 2,567 12-03-2014, 02:45 PM
Last Post: viki
  MGT602 Entrepreneurship GDB No 1 Discussion and Solution Fall 2014 Vuhelper 0 2,521 12-02-2014, 10:36 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support